提交 f98d9ca1 编写于 作者: D Dan Carpenter 提交者: Jens Axboe

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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 1fb47040
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册