diff mbox

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

Message ID 1465389066-19119-9-git-send-email-hch@lst.de (mailing list archive)
State New, archived
Headers show

Commit Message

Christoph Hellwig June 8, 2016, 12:31 p.m. UTC
From: kbuild test robot <lkp@intel.com>

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@lst.de>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/nvme/target/configfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Ming Lin June 8, 2016, 10:09 p.m. UTC | #1
Looks good.

Reviewed-by: Ming Lin <ming.l@samsung.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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);