* [PATCH] extcon: add index increment in find_cable_index_by_name
@ 2015-08-10 17:44 Tim Bird
2015-08-10 19:18 ` Tim Bird
0 siblings, 1 reply; 2+ messages in thread
From: Tim Bird @ 2015-08-10 17:44 UTC (permalink / raw)
To: myungjoo.ham, cw00.choi; +Cc: linux-kernel, tbird20d, tim.bird, bjorn.andersson
This fixes a bug introduced by commit 73b6ecdb93e8 ("extcon: Redefine the
unique id of supported external connectors without 'enum extcon' type")
which introduced an infinite loop in find_cable_index_by_name. That commit
converted the scan from a for loop to a while, but did not increment
'i' anywhere in the loop. If the loop index is not incremented, the
function never exits.
This function can never work correctly without this fix.
Signed-off-by: Tim Bird <tim.bird@sonymobile.com>
---
drivers/extcon/extcon.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index dda1e62..734a9b1 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -138,6 +138,7 @@ static int find_cable_index_by_name(struct extcon_dev *edev, const char *name)
id = i;
break;
}
+ i++;
}
if (id == EXTCON_NONE)
--
1.8.2.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] extcon: add index increment in find_cable_index_by_name
2015-08-10 17:44 [PATCH] extcon: add index increment in find_cable_index_by_name Tim Bird
@ 2015-08-10 19:18 ` Tim Bird
0 siblings, 0 replies; 2+ messages in thread
From: Tim Bird @ 2015-08-10 19:18 UTC (permalink / raw)
To: myungjoo.ham@samsung.com, cw00.choi@samsung.com
Cc: linux-kernel@vger.kernel.org, tbird20d@gmail.com,
"Andersson, Björn"
Never mind...
This is already fixed by commit be052cc8 in mainline.
Sorry for the noise.
-- Tim
On 08/10/2015 10:44 AM, Tim Bird wrote:
> This fixes a bug introduced by commit 73b6ecdb93e8 ("extcon: Redefine the
> unique id of supported external connectors without 'enum extcon' type")
> which introduced an infinite loop in find_cable_index_by_name. That commit
> converted the scan from a for loop to a while, but did not increment
> 'i' anywhere in the loop. If the loop index is not incremented, the
> function never exits.
>
> This function can never work correctly without this fix.
>
> Signed-off-by: Tim Bird <tim.bird@sonymobile.com>
> ---
> drivers/extcon/extcon.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
> index dda1e62..734a9b1 100644
> --- a/drivers/extcon/extcon.c
> +++ b/drivers/extcon/extcon.c
> @@ -138,6 +138,7 @@ static int find_cable_index_by_name(struct extcon_dev *edev, const char *name)
> id = i;
> break;
> }
> + i++;
> }
>
> if (id == EXTCON_NONE)
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-10 19:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-10 17:44 [PATCH] extcon: add index increment in find_cable_index_by_name Tim Bird
2015-08-10 19:18 ` Tim Bird
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.