lkml.org 
[lkml]   [2018]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] gpio: ep93xx: fix test for end of loop
From
Date
On 06/09/18 14:33, Dan Carpenter wrote:
> The problem is that if port == ARRAY_SIZE() and "gc == &epg->gc[port]"
> then that should be treated as invalid.
>
> Fixes: fd935fc421e7 ("gpio: ep93xx: Do not pingpong irq numbers")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/gpio/gpio-ep93xx.c b/drivers/gpio/gpio-ep93xx.c
> index 68a416fc3141..b0699f57ddf5 100644
> --- a/drivers/gpio/gpio-ep93xx.c
> +++ b/drivers/gpio/gpio-ep93xx.c
> @@ -80,7 +80,7 @@ static int ep93xx_gpio_port(struct gpio_chip *gc)
> port++;
>
> /* This should not happen but is there as a last safeguard */
> - if (gc != &epg->gc[port]) {
> + if (port == ARRAY_SIZE(epg->gc)) {
> pr_crit("can't find the GPIO port\n");
> return 0;
> }
>

Good catch! I overlooked that one.

\
 
 \ /
  Last update: 2018-09-06 15:51    [W:1.115 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site