Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Dan Carpenter and committed by
Jens Axboe
f98d9ca1 1fb47040

+2 -2
+2 -2
drivers/nvme/target/configfs.c
··· 737 737 738 738 port = kzalloc(sizeof(*port), GFP_KERNEL); 739 739 if (!port) 740 - return ERR_CAST(port); 740 + return ERR_PTR(-ENOMEM); 741 741 742 742 INIT_LIST_HEAD(&port->entry); 743 743 config_group_init_type_name(&port->group, name, &nvmet_referral_type); ··· 794 794 795 795 port = kzalloc(sizeof(*port), GFP_KERNEL); 796 796 if (!port) 797 - return ERR_CAST(port); 797 + return ERR_PTR(-ENOMEM); 798 798 799 799 INIT_LIST_HEAD(&port->entry); 800 800 INIT_LIST_HEAD(&port->subsystems);