[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120120161727.21955.7437.stgit@kaulin.local>
Date: Fri, 20 Jan 2012 08:17:27 -0800
From: Tony Lindgren <tony@...mide.com>
To: linux-kernel@...r.kernel.org
Cc: Stephen Warren <swarren@...dia.com>,
Linus Walleij <linus.walleij@...ricsson.com>,
Barry Song <21cnbao@...il.com>,
Haojian Zhuang <haojian.zhuang@...vell.com>,
Grant Likely <grant.likely@...retlab.ca>,
Thomas Abraham <thomas.abraham@...aro.org>,
Rajendra Nayak <rajendra.nayak@...aro.org>,
Dong Aisheng <dong.aisheng@...aro.org>,
Shawn Guo <shawn.guo@...escale.com>
Subject: [PATCH 2/4] pinctrl: Fix pinmux_hog_maps when ctrl_dev_name is not
set
The ctrl_dev_name is optional for struct pinmux_map assuming
that ctrl_dev is set. Without this patch we can get:
Unable to handle kernel NULL pointer dereference at virtual address 00000000
...
(pinmux_hog_maps+0xa4/0x20c)
(pinctrl_register+0x2a4/0x378)
...
Signed-off-by: Tony Lindgren <tony@...mide.com>
---
drivers/pinctrl/pinmux.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
index a76a348..06b8943 100644
--- a/drivers/pinctrl/pinmux.c
+++ b/drivers/pinctrl/pinmux.c
@@ -992,9 +992,12 @@ int pinmux_hog_maps(struct pinctrl_dev *pctldev)
for (i = 0; i < pinmux_maps_num; i++) {
struct pinmux_map const *map = &pinmux_maps[i];
+ int match_found = 0;
- if (((map->ctrl_dev == dev) ||
- !strcmp(map->ctrl_dev_name, devname)) &&
+ if (map->ctrl_dev_name && !strcmp(map->ctrl_dev_name, devname))
+ match_found = 1;
+
+ if (((map->ctrl_dev == dev) || match_found) &&
map->hog_on_boot) {
/* OK time to hog! */
ret = pinmux_hog_map(pctldev, map);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists