summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2015-05-19 18:29:48 +0200
committerWolfram Sang <wsa@the-dreams.de>2015-06-01 08:22:51 +0900
commit4c1344f105b626c222ea64669dc6dcfe100ccf3b (patch)
treed13c012a88dcc8b362364a57a69615e1e8da7505 /drivers/i2c
parent0c7cab96ec413a69af86965d94fb650f01c5887a (diff)
i2c: check for proper length of the reg property
int is vague, let's simply use the type of the variable in question. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/i2c-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 2a627eb0365b..b8f11b82485c 100644
--- 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);