]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: add param sanity check to i2c_transfer()
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 3 Apr 2018 19:11:50 +0000 (21:11 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Wed, 11 Apr 2018 21:33:46 +0000 (23:33 +0200)
commit1ca3f52d8ee27f9fb7daf576fd2ef020bad605cd
treeb8aabc3206f9064036a78593069ddf824f095aa2
parent50ff3d2c842a534cfad2c8317b31697feb63924c
i2c: add param sanity check to i2c_transfer()

The API docs describe i2c_transfer() as taking a pointer to an array
of i2c_msg containing at least 1 entry, but leaves it to the individual
drivers to sanity check the msgs and num parameters. Let's do this in
core code instead.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
[wsa: changed '<= 0' to '< 1']
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/i2c-core-base.c