public inbox for rulkc@linuxtesting.org
 help / color / mirror / Atom feed
* [rulkc] [PATCH v2] mtd: rawnand: fix condition in 'nand_select_target()'
@ 2026-05-05  8:30 avkrasnov
  2026-05-27  9:04 ` miquel.raynal
  0 siblings, 1 reply; 2+ messages in thread
From: avkrasnov @ 2026-05-05  8:30 UTC (permalink / raw)


'cs' here must be in range [0:nanddev_ntargets[.

Cc: stable at vger.kernel.org
Fixes: 32813e288414 ("mtd: rawnand: Get rid of chip->numchips")
Signed-off-by: Arseniy Krasnov <avkrasnov at rulkc.org>
---
 Changelog v1->v2:
 * Commit message typo updates.

 drivers/mtd/nand/raw/nand_base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index 13e4060bd1b6a..edfee22f15a73 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -174,7 +174,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;
-- 
2.47.3



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [rulkc] [PATCH v2] mtd: rawnand: fix condition in 'nand_select_target()'
  2026-05-05  8:30 [rulkc] [PATCH v2] mtd: rawnand: fix condition in 'nand_select_target()' avkrasnov
@ 2026-05-27  9:04 ` miquel.raynal
  0 siblings, 0 replies; 2+ messages in thread
From: miquel.raynal @ 2026-05-27  9:04 UTC (permalink / raw)


On Tue, 05 May 2026 11:30:30 +0300, Arseniy Krasnov wrote:
> 'cs' here must be in range [0:nanddev_ntargets[.
> 
> 

Applied to nand/next, thanks!

[1/1] mtd: rawnand: fix condition in 'nand_select_target()'
      commit: 8507c2cc9e4fa402401819f44d1e8a5ef4d11d8b

Patche(s) should be available on mtd/linux.git and will be
part of the next PR (provided that no robot complains by then).

Kind regards,
Miquèl



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-27  9:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-05  8:30 [rulkc] [PATCH v2] mtd: rawnand: fix condition in 'nand_select_target()' avkrasnov
2026-05-27  9:04 ` miquel.raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®