summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorStefan Schmidt <stefan@osg.samsung.com>2015-06-09 04:52:26 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-06-09 04:55:36 -0400
commite5719b661a978f7d23042c140979351951f970bb (patch)
treefdf782ca21ff1effef13faf0458741d0ce8ea8bf /drivers/net
parent9a4d3d4ba17c93def2b4dc3126eba30716d15469 (diff)
ieee802154/mrf24j40: make sure we do not override return values
If we run into an error during rx we set the the error code in ret, but override it afterwards. Using a different variable for the extra case avoids this situation. CID: 1226982, 1226983 Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com> Cc: Alan Ott <alan@signal11.us> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ieee802154/mrf24j40.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c
index 99c767695c7b..2549760e039f 100644
--- a/drivers/net/ieee802154/mrf24j40.c
+++ b/drivers/net/ieee802154/mrf24j40.c
@@ -533,6 +533,7 @@ static int mrf24j40_handle_rx(struct mrf24j40 *devrec)
533 u8 lqi = 0; 533 u8 lqi = 0;
534 u8 val; 534 u8 val;
535 int ret = 0; 535 int ret = 0;
536 int ret2;
536 struct sk_buff *skb; 537 struct sk_buff *skb;
537 538
538 /* Turn off reception of packets off the air. This prevents the 539 /* Turn off reception of packets off the air. This prevents the
@@ -569,9 +570,9 @@ static int mrf24j40_handle_rx(struct mrf24j40 *devrec)
569 570
570out: 571out:
571 /* Turn back on reception of packets off the air. */ 572 /* Turn back on reception of packets off the air. */
572 ret = read_short_reg(devrec, REG_BBREG1, &val); 573 ret2 = read_short_reg(devrec, REG_BBREG1, &val);
573 if (ret) 574 if (ret2)
574 return ret; 575 return ret2;
575 val &= ~0x4; /* Clear RXDECINV */ 576 val &= ~0x4; /* Clear RXDECINV */
576 write_short_reg(devrec, REG_BBREG1, val); 577 write_short_reg(devrec, REG_BBREG1, val);
577 578