Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: ieee802154: fix missing checks for regmap_update_bits

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>

authored by

Kangjie Lu and committed by
Stefan Schmidt
22e8860c 1c5c12ee

+6
+6
drivers/net/ieee802154/mcr20a.c
··· 533 533 dev_dbg(printdev(lp), "no slotted operation\n"); 534 534 ret = regmap_update_bits(lp->regmap_dar, DAR_PHY_CTRL1, 535 535 DAR_PHY_CTRL1_SLOTTED, 0x0); 536 + if (ret < 0) 537 + return ret; 536 538 537 539 /* enable irq */ 538 540 enable_irq(lp->spi->irq); ··· 542 540 /* Unmask SEQ interrupt */ 543 541 ret = regmap_update_bits(lp->regmap_dar, DAR_PHY_CTRL2, 544 542 DAR_PHY_CTRL2_SEQMSK, 0x0); 543 + if (ret < 0) 544 + return ret; 545 545 546 546 /* Start the RX sequence */ 547 547 dev_dbg(printdev(lp), "start the RX sequence\n"); 548 548 ret = regmap_update_bits(lp->regmap_dar, DAR_PHY_CTRL1, 549 549 DAR_PHY_CTRL1_XCVSEQ_MASK, MCR20A_XCVSEQ_RX); 550 + if (ret < 0) 551 + return ret; 550 552 551 553 return 0; 552 554 }