Commit e5719b66 authored by Stefan Schmidt's avatar Stefan Schmidt Committed by Marcel Holtmann

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: default avatarStefan Schmidt <stefan@osg.samsung.com>
Cc: Alan Ott <alan@signal11.us>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 9a4d3d4b
...@@ -533,6 +533,7 @@ static int mrf24j40_handle_rx(struct mrf24j40 *devrec) ...@@ -533,6 +533,7 @@ static int mrf24j40_handle_rx(struct mrf24j40 *devrec)
u8 lqi = 0; u8 lqi = 0;
u8 val; u8 val;
int ret = 0; int ret = 0;
int ret2;
struct sk_buff *skb; struct sk_buff *skb;
/* Turn off reception of packets off the air. This prevents the /* Turn off reception of packets off the air. This prevents the
...@@ -569,9 +570,9 @@ static int mrf24j40_handle_rx(struct mrf24j40 *devrec) ...@@ -569,9 +570,9 @@ static int mrf24j40_handle_rx(struct mrf24j40 *devrec)
out: out:
/* Turn back on reception of packets off the air. */ /* Turn back on reception of packets off the air. */
ret = read_short_reg(devrec, REG_BBREG1, &val); ret2 = read_short_reg(devrec, REG_BBREG1, &val);
if (ret) if (ret2)
return ret; return ret2;
val &= ~0x4; /* Clear RXDECINV */ val &= ~0x4; /* Clear RXDECINV */
write_short_reg(devrec, REG_BBREG1, val); write_short_reg(devrec, REG_BBREG1, val);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment