Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f98d9ca1 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jens Axboe
Browse files

nvmet: fix an error code



We accidentally return zero here when ERR_PTR(-ENOMEM) is intended.

Fixes: a07b4970 ('nvmet: add a generic NVMe target')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 1fb47040
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -737,7 +737,7 @@ static struct config_group *nvmet_referral_make(


	port = kzalloc(sizeof(*port), GFP_KERNEL);
	port = kzalloc(sizeof(*port), GFP_KERNEL);
	if (!port)
	if (!port)
		return ERR_CAST(port);
		return ERR_PTR(-ENOMEM);


	INIT_LIST_HEAD(&port->entry);
	INIT_LIST_HEAD(&port->entry);
	config_group_init_type_name(&port->group, name, &nvmet_referral_type);
	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);
	port = kzalloc(sizeof(*port), GFP_KERNEL);
	if (!port)
	if (!port)
		return ERR_CAST(port);
		return ERR_PTR(-ENOMEM);


	INIT_LIST_HEAD(&port->entry);
	INIT_LIST_HEAD(&port->entry);
	INIT_LIST_HEAD(&port->subsystems);
	INIT_LIST_HEAD(&port->subsystems);