extcon: Fix kernel hang for find_cable_index_by_name() users
diff mbox

Message ID 1436185889-773-1-git-send-email-rogerq@ti.com
State New
Headers show

Commit Message

Roger Quadros July 6, 2015, 12:31 p.m. UTC
Users of find_cable_index_by_name() will cause a kernel hang
as the while loop counter is never incremented and end condition
is never reached.

Fixes: commit 73b6ecdb93e8 ("extcon: Redefine the unique id of supported external connectors without 'enum extcon' type")
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/extcon/extcon.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Roger Quadros July 6, 2015, 1:38 p.m. UTC | #1
Hi,

On 06/07/15 15:31, Roger Quadros wrote:
> Users of find_cable_index_by_name() will cause a kernel hang
> as the while loop counter is never incremented and end condition
> is never reached.
>
> Fixes: commit 73b6ecdb93e8 ("extcon: Redefine the unique id of supported external connectors without 'enum extcon' type")
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Please ignore this patch.
The extcon framework is broken bad in v4.2 and this patch is not 
sufficient to fix it.

I will send another patch that fixes the issues that I'm facing in a while.

cheers,
-roger


> ---
>   drivers/extcon/extcon.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
> index 76157ab..1acc830 100644
> --- a/drivers/extcon/extcon.c
> +++ b/drivers/extcon/extcon.c
> @@ -138,6 +138,8 @@ static int find_cable_index_by_name(struct extcon_dev *edev, const char *name)
>   			id = i;
>   			break;
>   		}
> +
> +		i++;
>   	}
>
>   	if (id == EXTCON_NONE)
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index 76157ab..1acc830 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -138,6 +138,8 @@  static int find_cable_index_by_name(struct extcon_dev *edev, const char *name)
 			id = i;
 			break;
 		}
+
+		i++;
 	}
 
 	if (id == EXTCON_NONE)