All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bluetooth-next] at86rf230: fix at86rf230_read_subreg succeed handling
@ 2015-03-17  9:32 Alexander Aring
  2015-03-17 15:31 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Aring @ 2015-03-17  9:32 UTC (permalink / raw)
  To: linux-wpan; +Cc: kernel, Alexander Aring

This patch fix an issue when at86rf230_read_subreg was successful. The
function at86rf230_read_subreg will directly call regmap_read which
returns zero on successful. Nobody figured out issues yet because it was
only necessary to evaluate dvdd state while probing. This could make
trouble because the stack variable could have an random value.

The function is also used by reset the irq line before requesting irq, but
the value isn't evaluated afterwards.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
 drivers/net/ieee802154/at86rf230.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index b64c5c7..cc5efa1 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -325,7 +325,7 @@ at86rf230_read_subreg(struct at86rf230_local *lp,
 	int rc;
 
 	rc = __at86rf230_read(lp, addr, data);
-	if (rc > 0)
+	if (!rc)
 		*data = (*data & mask) >> shift;
 
 	return rc;
-- 
2.3.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH bluetooth-next] at86rf230: fix at86rf230_read_subreg succeed handling
  2015-03-17  9:32 [PATCH bluetooth-next] at86rf230: fix at86rf230_read_subreg succeed handling Alexander Aring
@ 2015-03-17 15:31 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2015-03-17 15:31 UTC (permalink / raw)
  To: Alexander Aring; +Cc: linux-wpan, kernel

Hi Alex,

> This patch fix an issue when at86rf230_read_subreg was successful. The
> function at86rf230_read_subreg will directly call regmap_read which
> returns zero on successful. Nobody figured out issues yet because it was
> only necessary to evaluate dvdd state while probing. This could make
> trouble because the stack variable could have an random value.
> 
> The function is also used by reset the irq line before requesting irq, but
> the value isn't evaluated afterwards.
> 
> Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> ---
> drivers/net/ieee802154/at86rf230.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-17 15:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-17  9:32 [PATCH bluetooth-next] at86rf230: fix at86rf230_read_subreg succeed handling Alexander Aring
2015-03-17 15:31 ` Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.