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>
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);
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);