From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============2194521379104991002==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: [PATCH] i2c: dev: fix eno.cocci warnings Date: Thu, 25 Nov 2021 14:00:02 +0800 Message-ID: <20211125060002.GA50659@8aec8ecfd301> In-Reply-To: <20211115024926.205385-3-matt@codeconstruct.com.au> List-Id: --===============2194521379104991002== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: kernel test robot drivers/i2c/i2c-dev.c:291:6-12: ERROR: allocation function on line 289 retu= rns 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 Reported-by: kernel test robot Signed-off-by: kernel test robot --- url: https://github.com/0day-ci/linux/commits/Matt-Johnston/MCTP-I2C-dri= ver/20211115-105011 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] =3D msgs[i].len; msgs[i].buf =3D kmalloc(msgs[i].len + I2C_SMBUS_V3_BLOCK_MAX, GFP_USER | __GFP_NOWARN); - if (IS_ERR(msgs[i].buf)) { + if (!msgs[i].buf) { res =3D PTR_ERR(msgs[i].buf); break; } --===============2194521379104991002==--