Skip to contentSkip to conversation

extcon: Fix kernel hang for find_cable_index_by_name() users

PATCH In review Roger Quadros 1 participant 2 messages Jul 6, 2015 External connector subsystem (extcon)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 extcon: Fix kernel hang for find_cable_index_by_name() users

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 <[email protected]>
---
 drivers/extcon/extcon.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/extcon/extcon.c +2 -0
index 76157ab..1acc830 100644
@@ -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)
Signature · 1 line
2.1.4
#1 lore raw

Hi,

Quoted 7 lines · Roger Quadros

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 <[email protected]>

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

Quoted 18 lines
---
  drivers/extcon/extcon.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/extcon/extcon.c +2 -0
index 76157ab..1acc830 100644
@@ -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)