From: dan.carpenter@oracle.com (Dan Carpenter)
Subject: [patch] nvmet: fix an error code
Date: Thu, 7 Jul 2016 11:15:26 +0300 [thread overview]
Message-ID: <20160707081526.GA16742@mwanda> (raw)
We accidentally return zero here when ERR_PTR(-ENOMEM) is intended.
Fixes: a07b4970f464 ('nvmet: add a generic NVMe target')
Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>
diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
index 9bed302..af5e2dc 100644
--- a/drivers/nvme/target/configfs.c
+++ b/drivers/nvme/target/configfs.c
@@ -737,7 +737,7 @@ static struct config_group *nvmet_referral_make(
port = kzalloc(sizeof(*port), GFP_KERNEL);
if (!port)
- return ERR_CAST(port);
+ return ERR_PTR(-ENOMEM);
INIT_LIST_HEAD(&port->entry);
config_group_init_type_name(&port->group, name, &nvmet_referral_type);
@@ -794,7 +794,7 @@ static struct config_group *nvmet_ports_make(struct config_group *group,
port = kzalloc(sizeof(*port), GFP_KERNEL);
if (!port)
- return ERR_CAST(port);
+ return ERR_PTR(-ENOMEM);
INIT_LIST_HEAD(&port->entry);
INIT_LIST_HEAD(&port->subsystems);
next reply other threads:[~2016-07-07 8:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-07 8:15 Dan Carpenter [this message]
2016-07-07 14:37 ` [patch] nvmet: fix an error code Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160707081526.GA16742@mwanda \
--to=dan.carpenter@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).