linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [patch 1/2] mtd: spi-nor: Off by one in cqspi_setup_flash()
@ 2016-10-13  8:06 Dan Carpenter
  2016-10-14  7:19 ` Marek Vasut
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2016-10-13  8:06 UTC (permalink / raw)
  To: David Woodhouse, Graham Moore
  Cc: Brian Norris, Marek Vasut, linux-mtd, kernel-janitors

There are CQSPI_MAX_CHIPSELECT elements in the ->f_pdata array so the >
should be >=.

Fixes: 140623410536 ('mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/mtd/spi-nor/cadence-quadspi.c b/drivers/mtd/spi-nor/cadence-quadspi.c
index d403ba7..944863b 100644
--- a/drivers/mtd/spi-nor/cadence-quadspi.c
+++ b/drivers/mtd/spi-nor/cadence-quadspi.c
@@ -1082,7 +1082,7 @@ static int cqspi_setup_flash(struct cqspi_st *cqspi, struct device_node *np)
 			goto err;
 		}
 
-		if (cs > CQSPI_MAX_CHIPSELECT) {
+		if (cs >= CQSPI_MAX_CHIPSELECT) {
 			dev_err(dev, "Chip select %d out of range.\n", cs);
 			goto err;
 		}

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

* Re: [patch 1/2] mtd: spi-nor: Off by one in cqspi_setup_flash()
  2016-10-13  8:06 [patch 1/2] mtd: spi-nor: Off by one in cqspi_setup_flash() Dan Carpenter
@ 2016-10-14  7:19 ` Marek Vasut
  2016-11-28  8:19   ` Cyrille Pitchen
  0 siblings, 1 reply; 3+ messages in thread
From: Marek Vasut @ 2016-10-14  7:19 UTC (permalink / raw)
  To: Dan Carpenter, David Woodhouse, Graham Moore
  Cc: Brian Norris, linux-mtd, kernel-janitors

On 10/13/2016 10:06 AM, Dan Carpenter wrote:
> There are CQSPI_MAX_CHIPSELECT elements in the ->f_pdata array so the >
> should be >=.
> 
> Fixes: 140623410536 ('mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Marek Vasut <marex@denx.de>

> diff --git a/drivers/mtd/spi-nor/cadence-quadspi.c b/drivers/mtd/spi-nor/cadence-quadspi.c
> index d403ba7..944863b 100644
> --- a/drivers/mtd/spi-nor/cadence-quadspi.c
> +++ b/drivers/mtd/spi-nor/cadence-quadspi.c
> @@ -1082,7 +1082,7 @@ static int cqspi_setup_flash(struct cqspi_st *cqspi, struct device_node *np)
>  			goto err;
>  		}
>  
> -		if (cs > CQSPI_MAX_CHIPSELECT) {
> +		if (cs >= CQSPI_MAX_CHIPSELECT) {
>  			dev_err(dev, "Chip select %d out of range.\n", cs);
>  			goto err;
>  		}
> 


-- 
Best regards,
Marek Vasut

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

* Re: [patch 1/2] mtd: spi-nor: Off by one in cqspi_setup_flash()
  2016-10-14  7:19 ` Marek Vasut
@ 2016-11-28  8:19   ` Cyrille Pitchen
  0 siblings, 0 replies; 3+ messages in thread
From: Cyrille Pitchen @ 2016-11-28  8:19 UTC (permalink / raw)
  To: Marek Vasut, Dan Carpenter, David Woodhouse, Graham Moore
  Cc: kernel-janitors, Brian Norris, linux-mtd

Le 14/10/2016 à 09:19, Marek Vasut a écrit :
> On 10/13/2016 10:06 AM, Dan Carpenter wrote:
>> There are CQSPI_MAX_CHIPSELECT elements in the ->f_pdata array so the >
>> should be >=.
>>
>> Fixes: 140623410536 ('mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller')
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Reviewed-by: Marek Vasut <marex@denx.de>
Applied to git://github.com/spi-nor/linux.git

Thanks!
> 
>> diff --git a/drivers/mtd/spi-nor/cadence-quadspi.c b/drivers/mtd/spi-nor/cadence-quadspi.c
>> index d403ba7..944863b 100644
>> --- a/drivers/mtd/spi-nor/cadence-quadspi.c
>> +++ b/drivers/mtd/spi-nor/cadence-quadspi.c
>> @@ -1082,7 +1082,7 @@ static int cqspi_setup_flash(struct cqspi_st *cqspi, struct device_node *np)
>>  			goto err;
>>  		}
>>  
>> -		if (cs > CQSPI_MAX_CHIPSELECT) {
>> +		if (cs >= CQSPI_MAX_CHIPSELECT) {
>>  			dev_err(dev, "Chip select %d out of range.\n", cs);
>>  			goto err;
>>  		}
>>
> 
> 

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

end of thread, other threads:[~2016-11-28  8:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-13  8:06 [patch 1/2] mtd: spi-nor: Off by one in cqspi_setup_flash() Dan Carpenter
2016-10-14  7:19 ` Marek Vasut
2016-11-28  8:19   ` Cyrille Pitchen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).