scsi: mpi3mr: Use -ENOMEM instead of -1 in mpi3mr_expander_add()
authorHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Wed, 19 Apr 2023 06:42:56 +0000 (23:42 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 8 May 2023 11:19:20 +0000 (07:19 -0400)
smatch warnings:

drivers/scsi/mpi3mr/mpi3mr_transport.c:1449 mpi3mr_expander_add() warn:
returning -1 instead of -ENOMEM is sloppy

No functional change.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/202303202027.ZeDQE5Ug-lkp@intel.com/
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Link: https://lore.kernel.org/r/20230419064256.2532069-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpi3mr/mpi3mr_transport.c

index 4d84d5b..82b55e9 100644 (file)
@@ -2058,7 +2058,7 @@ int mpi3mr_expander_add(struct mpi3mr_ioc *mrioc, u16 handle)
        sas_expander = kzalloc(sizeof(struct mpi3mr_sas_node),
            GFP_KERNEL);
        if (!sas_expander)
-               return -1;
+               return -ENOMEM;
 
        sas_expander->handle = handle;
        sas_expander->num_phys = expander_pg0.num_phys;