Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf703c3f authored by Adrian Bunk's avatar Adrian Bunk Committed by Linus Torvalds
Browse files

[PATCH] drivers/mfd/sm501.c: fix an off-by-one



Fix an off-by-one spotted by the Coverity checker.

Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Vincent Sanders <vince@arm.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 10fa1155
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -319,7 +319,7 @@ int sm501_unit_power(struct device *dev, unsigned int unit, unsigned int to)


	mode &= 3;		/* get current power mode */
	mode &= 3;		/* get current power mode */


	if (unit > ARRAY_SIZE(sm->unit_power)) {
	if (unit >= ARRAY_SIZE(sm->unit_power)) {
		dev_err(dev, "%s: bad unit %d\n", __FUNCTION__, unit);
		dev_err(dev, "%s: bad unit %d\n", __FUNCTION__, unit);
		goto already;
		goto already;
	}
	}