From: kernel test robot <lkp(a)intel.com>
drivers/i2c/i2c-dev.c:291:6-12: ERROR: allocation function on line 289 returns NULL not
ERR_PTR on failure
The various basic memory allocation functions don't return ERR_PTR
Generated by: scripts/coccinelle/null/eno.cocci
CC: Matt Johnston <matt(a)codeconstruct.com.au>
Reported-by: kernel test robot <lkp(a)intel.com>
Signed-off-by: kernel test robot <lkp(a)intel.com>
---
url:
https://github.com/0day-ci/linux/commits/Matt-Johnston/MCTP-I2C-driver/20...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
1274a4eb318debe33e395bb8bcf8b98e6eb4670f
:::::: branch date: 10 days ago
:::::: commit date: 10 days ago
i2c-dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -288,7 +288,7 @@ static noinline int i2cdev_ioctl_rdwr(st
orig_lens[i] = msgs[i].len;
msgs[i].buf = kmalloc(msgs[i].len + I2C_SMBUS_V3_BLOCK_MAX,
GFP_USER | __GFP_NOWARN);
- if (IS_ERR(msgs[i].buf)) {
+ if (!msgs[i].buf) {
res = PTR_ERR(msgs[i].buf);
break;
}