From: Sasha Levin <sashal@kernel•org>
To: linux-kernel@vger•kernel.org, stable@vger•kernel.org
Cc: Kangjie Lu <kjlu@umn•edu>, Mukesh Ojha <mojha@codeaurora•org>,
Stefan Schmidt <stefan@datenfreihafen•org>,
Sasha Levin <sashal@kernel•org>,
linux-wpan@vger•kernel.org, netdev@vger•kernel.org
Subject: [PATCH AUTOSEL 5.0 19/34] net: ieee802154: fix missing checks for regmap_update_bits
Date: Thu, 16 May 2019 07:39:16 -0400 [thread overview]
Message-ID: <20190516113932.8348-19-sashal@kernel.org> (raw)
In-Reply-To: <20190516113932.8348-1-sashal@kernel.org>
From: Kangjie Lu <kjlu@umn•edu>
[ Upstream commit 22e8860cf8f777fbf6a83f2fb7127f682a8e9de4 ]
regmap_update_bits could fail and deserves a check.
The patch adds the checks and if it fails, returns its error
code upstream.
Signed-off-by: Kangjie Lu <kjlu@umn•edu>
Reviewed-by: Mukesh Ojha <mojha@codeaurora•org>
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen•org>
Signed-off-by: Sasha Levin <sashal@kernel•org>
---
drivers/net/ieee802154/mcr20a.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/ieee802154/mcr20a.c b/drivers/net/ieee802154/mcr20a.c
index c589f5ae75bb5..8bb53ec8d9cf2 100644
--- a/drivers/net/ieee802154/mcr20a.c
+++ b/drivers/net/ieee802154/mcr20a.c
@@ -533,6 +533,8 @@ mcr20a_start(struct ieee802154_hw *hw)
dev_dbg(printdev(lp), "no slotted operation\n");
ret = regmap_update_bits(lp->regmap_dar, DAR_PHY_CTRL1,
DAR_PHY_CTRL1_SLOTTED, 0x0);
+ if (ret < 0)
+ return ret;
/* enable irq */
enable_irq(lp->spi->irq);
@@ -540,11 +542,15 @@ mcr20a_start(struct ieee802154_hw *hw)
/* Unmask SEQ interrupt */
ret = regmap_update_bits(lp->regmap_dar, DAR_PHY_CTRL2,
DAR_PHY_CTRL2_SEQMSK, 0x0);
+ if (ret < 0)
+ return ret;
/* Start the RX sequence */
dev_dbg(printdev(lp), "start the RX sequence\n");
ret = regmap_update_bits(lp->regmap_dar, DAR_PHY_CTRL1,
DAR_PHY_CTRL1_XCVSEQ_MASK, MCR20A_XCVSEQ_RX);
+ if (ret < 0)
+ return ret;
return 0;
}
--
2.20.1
next prev parent reply other threads:[~2019-05-16 11:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-16 11:38 [PATCH AUTOSEL 5.0 01/34] xfrm: policy: Fix out-of-bound array accesses in __xfrm_policy_unlink Sasha Levin
2019-05-16 11:38 ` [PATCH AUTOSEL 5.0 02/34] xfrm: Reset secpath in xfrm failure Sasha Levin
2019-05-16 11:39 ` [PATCH AUTOSEL 5.0 03/34] xfrm6_tunnel: Fix potential panic when unloading xfrm6_tunnel module Sasha Levin
2019-05-16 11:39 ` [PATCH AUTOSEL 5.0 04/34] vti4: ipip tunnel deregistration fixes Sasha Levin
2019-05-16 11:39 ` [PATCH AUTOSEL 5.0 05/34] xfrm: clean up xfrm protocol checks Sasha Levin
2019-05-16 11:39 ` [PATCH AUTOSEL 5.0 06/34] esp4: add length check for UDP encapsulation Sasha Levin
2019-05-16 11:39 ` [PATCH AUTOSEL 5.0 07/34] xfrm: Honor original L3 slave device in xfrmi policy lookup Sasha Levin
2019-05-16 11:39 ` [PATCH AUTOSEL 5.0 08/34] xfrm4: Fix uninitialized memory read in _decode_session4 Sasha Levin
2019-05-16 11:39 ` [PATCH AUTOSEL 5.0 18/34] mac80211: Fix kernel panic due to use of txq after free Sasha Levin
2019-05-16 11:39 ` Sasha Levin [this message]
2019-05-16 11:39 ` [PATCH AUTOSEL 5.0 22/34] tools: bpftool: fix infinite loop in map create Sasha Levin
2019-05-16 11:39 ` [PATCH AUTOSEL 5.0 23/34] bpf: Fix preempt_enable_no_resched() abuse Sasha Levin
2019-05-16 11:39 ` [PATCH AUTOSEL 5.0 24/34] qmi_wwan: new Wistron, ZTE and D-Link devices Sasha Levin
2019-05-16 11:39 ` [PATCH AUTOSEL 5.0 25/34] iwlwifi: mvm: check for length correctness in iwl_mvm_create_skb() Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190516113932.8348-19-sashal@kernel.org \
--to=sashal@kernel$(echo .)org \
--cc=kjlu@umn$(echo .)edu \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-wpan@vger$(echo .)kernel.org \
--cc=mojha@codeaurora$(echo .)org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=stable@vger$(echo .)kernel.org \
--cc=stefan@datenfreihafen$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox