From: Dan Carpenter Date: Thu, 7 Jul 2016 08:15:26 +0000 (+0300) Subject: nvmet: fix an error code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f98d9ca17fbddd82980bc20abfabd5b405ecade4;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Jens Axboe --- 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);