[PATCH 08/11] nvmet: fix eno.cocci warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: kbuild test robot <lkp@xxxxxxxxx>

drivers/nvme/target/configfs.c:796:5-11: ERROR: allocation function on line 795 returns NULL not ERR_PTR on failure
drivers/nvme/target/configfs.c:739:5-11: ERROR: allocation function on line 738 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: Christoph Hellwig <hch@xxxxxx>
Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
 drivers/nvme/target/configfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
index aebe646..9bed302 100644
--- a/drivers/nvme/target/configfs.c
+++ b/drivers/nvme/target/configfs.c
@@ -736,7 +736,7 @@ static struct config_group *nvmet_referral_make(
 	struct nvmet_port *port;
 
 	port = kzalloc(sizeof(*port), GFP_KERNEL);
-	if (IS_ERR(port))
+	if (!port)
 		return ERR_CAST(port);
 
 	INIT_LIST_HEAD(&port->entry);
@@ -793,7 +793,7 @@ static struct config_group *nvmet_ports_make(struct config_group *group,
 		return ERR_PTR(-EINVAL);
 
 	port = kzalloc(sizeof(*port), GFP_KERNEL);
-	if (IS_ERR(port))
+	if (!port)
 		return ERR_CAST(port);
 
 	INIT_LIST_HEAD(&port->entry);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux