projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7d1311b
)
regmap: fix NULL pointer dereference in _regmap_write/read
author
Pankaj Dubey
<
[email protected]
>
Sat, 27 Sep 2014 04:17:55 +0000
(09:47 +0530)
committer
Mark Brown
<
[email protected]
>
Sat, 27 Sep 2014 11:21:15 +0000
(12:21 +0100)
If LOG_DEVICE is defined and map->dev is NULL it will lead to NULL
pointer dereference. This patch fixes this issue by adding check for
dev->NULL in all such places in regmap.c
Signed-off-by: Pankaj Dubey <
[email protected]
>
Signed-off-by: Mark Brown <
[email protected]
>
Cc:
[email protected]
drivers/base/regmap/regmap.c
patch
|
blob
|
history
diff --git
a/drivers/base/regmap/regmap.c
b/drivers/base/regmap/regmap.c
index 78f43fb2fe84647d5e97d5c9f6468cf6c8704187..b903aff59af392b7bda6de21400db9fcacccf4b9 100644
(file)
--- a/
drivers/base/regmap/regmap.c
+++ b/
drivers/base/regmap/regmap.c
@@
-1408,7
+1408,7
@@
int _regmap_write(struct regmap *map, unsigned int reg,
}
#ifdef LOG_DEVICE
- if (strcmp(dev_name(map->dev), LOG_DEVICE) == 0)
+ if (
map->dev &&
strcmp(dev_name(map->dev), LOG_DEVICE) == 0)
dev_info(map->dev, "%x <= %x\n", reg, val);
#endif
@@
-2058,7
+2058,7
@@
static int _regmap_read(struct regmap *map, unsigned int reg,
ret = map->reg_read(context, reg, val);
if (ret == 0) {
#ifdef LOG_DEVICE
- if (strcmp(dev_name(map->dev), LOG_DEVICE) == 0)
+ if (
map->dev &&
strcmp(dev_name(map->dev), LOG_DEVICE) == 0)
dev_info(map->dev, "%x => %x\n", reg, *val);
#endif