[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20230522155835.46756-1-miquel.raynal@bootlin.com>
Date: Mon, 22 May 2023 17:58:35 +0200
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Tudor Ambarus <tudor.ambarus@...aro.org>,
miquel.raynal@...tlin.com, richard@....at, todd.e.brandt@...el.com
Cc: vigneshr@...com, pratyush@...nel.org, michael@...le.cc,
linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org,
regressions@...mhuis.info, bagasdotme@...il.com,
regressions@...ts.linux.dev, joneslee@...gle.com,
Todd Brandt <todd.e.brandt@...ux.intel.com>
Subject: Re: [PATCH] mtd: spi-nor: Fix divide by zero for spi-nor-generic flashes
On Thu, 2023-05-18 at 08:54:40 UTC, Tudor Ambarus wrote:
> We failed to initialize n_banks for spi-nor-generic flashes, which
> caused a devide by zero when computing the bank_size.
>
> By default we consider that all chips have a single bank. Initialize
> the default number of banks for spi-nor-generic flashes. Even if the
> bug is fixed with this simple initialization, check the n_banks value
> before dividing so that we make sure this kind of bug won't occur again
> if some other struct instance is created uninitialized.
>
> Suggested-by: Todd Brandt <todd.e.brandt@...ux.intel.com>
> Reported-by: Todd Brandt <todd.e.brandt@...ux.intel.com>
> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217448
> Fixes: 9d6c5d64f028 ("mtd: spi-nor: Introduce the concept of bank")
> Link: https://lore.kernel.org/all/20230516225108.29194-1-todd.e.brandt@intel.com/
> Signed-off-by: Tudor Ambarus <tudor.ambarus@...aro.org>
> Tested-by: Todd Brandt <todd.e.brandt@...ux.intel.com>
> Reviewed-by: Miquel Raynal <miquel.raynal@...tlin.com>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/fixes, thanks.
Miquel
Powered by blists - more mailing lists