OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
i2c: check for proper length of the reg property
[uclinux-h8/linux.git]
/
drivers
/
i2c
/
i2c-core.c
diff --git
a/drivers/i2c/i2c-core.c
b/drivers/i2c/i2c-core.c
index
2a627eb
..
b8f11b8
100644
(file)
--- a/
drivers/i2c/i2c-core.c
+++ b/
drivers/i2c/i2c-core.c
@@
-1272,7
+1272,7
@@
static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap,
}
addr = of_get_property(node, "reg", &len);
- if (!addr || (len < sizeof(
int
))) {
+ if (!addr || (len < sizeof(
*addr
))) {
dev_err(&adap->dev, "of_i2c: invalid reg on %s\n",
node->full_name);
return ERR_PTR(-EINVAL);