aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-core-base.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-04-13 15:13:18 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-04-13 15:13:18 -0700
commit3e565a351ed3e94352bfbe0be06c659fc8fafb19 (patch)
treeea0c23c03484140413f4dcb75d11c69c05d5cdb0 /drivers/i2c/i2c-core-base.c
parentMerge tag 'sh-for-4.17' of git://git.libc.org/linux-sh (diff)
parenti2c: add param sanity check to i2c_transfer() (diff)
downloadlinux-dev-3e565a351ed3e94352bfbe0be06c659fc8fafb19.tar.xz
linux-dev-3e565a351ed3e94352bfbe0be06c659fc8fafb19.zip
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull more i2c updates from Wolfram Sang: - hot bugfix for i801 to make laptops with strange BIOS reboot again when using SMBUS Host notify - change to MAINTAINERS creating a specific fallback entry for I2C host drivers and settings its status to "Odd fixes" - a long overdue param checking for the I2C core * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: add param sanity check to i2c_transfer() MAINTAINERS: add maintainer for Renesas I2C related drivers MAINTAINERS: remove me as maintainer for I2C host drivers i2c: i801: Restore configuration at shutdown i2c: i801: Save register SMBSLVCMD value only once
Diffstat (limited to 'drivers/i2c/i2c-core-base.c')
-rw-r--r--drivers/i2c/i2c-core-base.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index 1adeebaa81b0..1ba40bb2b966 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -1845,6 +1845,9 @@ int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
unsigned long orig_jiffies;
int ret, try;
+ if (WARN_ON(!msgs || num < 1))
+ return -EINVAL;
+
if (adap->quirks && i2c_check_for_quirks(adap, msgs, num))
return -EOPNOTSUPP;