mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
mtd: rawnand: fix condition in 'nand_select_target()'
'cs' here must be in range [0:nanddev_ntargets[.
Cc: stable@vger.kernel.org
Fixes: 32813e2884 ("mtd: rawnand: Get rid of chip->numchips")
Signed-off-by: Arseniy Krasnov <avkrasnov@rulkc.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
This commit is contained in:
parent
9e3997d3ab
commit
8507c2cc9e
|
|
@ -175,7 +175,7 @@ void nand_select_target(struct nand_chip *chip, unsigned int cs)
|
|||
* cs should always lie between 0 and nanddev_ntargets(), when that's
|
||||
* not the case it's a bug and the caller should be fixed.
|
||||
*/
|
||||
if (WARN_ON(cs > nanddev_ntargets(&chip->base)))
|
||||
if (WARN_ON(cs >= nanddev_ntargets(&chip->base)))
|
||||
return;
|
||||
|
||||
chip->cur_cs = cs;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user