summaryrefslogtreecommitdiff
path: root/drivers/nvme
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-07-07 11:15:26 +0300
committerJens Axboe <axboe@fb.com>2016-07-07 17:37:36 +0300
commitf98d9ca17fbddd82980bc20abfabd5b405ecade4 (patch)
treec6a147005e6f26740ea4d7584adf4cd6d4d549a6 /drivers/nvme
parent1fb470408497382a0cf5311d9fa362202b537ebf (diff)
downloadlinux-f98d9ca17fbddd82980bc20abfabd5b405ecade4.tar.xz
nvmet: fix an error code
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@oracle.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/target/configfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
index 9bed302789a2..af5e2dc4a3d5 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);