mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
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>
This commit is contained in:
parent
0c7cab96ec
commit
4c1344f105
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user