lkml.org 
[lkml]   [2012]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 3/4] pinctrl: Add checks for empty names in pinmux_search_function
From
Date
Otherwise we can get the following when dealing with
buggy data in a pinmux driver:

Unable to handle kernel NULL pointer dereference at virtual address 00000000
...
PC is at strcmp+0xc/0x34
LR is at pinmux_get+0x350/0x8f4
...

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
drivers/pinctrl/pinmux.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
index 06b8943..ffe633d 100644
--- a/drivers/pinctrl/pinmux.c
+++ b/drivers/pinctrl/pinmux.c
@@ -584,6 +584,13 @@ static int pinmux_search_function(struct pinctrl_dev *pctldev,
selector);
int ret;

+ if (!fname) {
+ pr_warning("no name for function%i\n",
+ selector);
+ selector++;
+ continue;
+ }
+
if (!strcmp(map->function, fname)) {
/* Found the function, check pin group */
ret = pinmux_check_pin_group(pctldev, selector,


\
 
 \ /
  Last update: 2012-01-20 17:21    [W:3.254 / U:1.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site