[PATCH v1 2/9] pinctrl: tegra30: fix "Possible null pointer dereference: group" warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The code is correct but it takes more seconds for me to understand.
And static code analyzer do not understand it at all.

Signed-off-by: Oleksij Rempel <linux@xxxxxxxxxxxxxxxx>
---
 drivers/pinctrl/pinctrl-tegra30.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-tegra30.c b/drivers/pinctrl/pinctrl-tegra30.c
index d9b49c57d..ffb04eebb 100644
--- a/drivers/pinctrl/pinctrl-tegra30.c
+++ b/drivers/pinctrl/pinctrl-tegra30.c
@@ -658,8 +658,8 @@ static int pinctrl_tegra30_set_drvstate(struct pinctrl_tegra30 *ctrl,
 			break;
 		}
 	}
-	/* if no matching drivegroup is found */
-	if (i == ctrl->drvdata->num_drvgrps)
+
+	if (!group)
 		return 0;
 
 	regaddr = ctrl->regs.ctrl + (group->reg >> 2);
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux