scsi: core: return -ENOMEM on ips_init_phase1() allocation failure
Subsystems (3)
PATCH 1/1 scsi: core: return -ENOMEM on ips_init_phase1() allocation failure
From: chongjiapeng <[email protected]>
Fixes the following smatch warning:
drivers/scsi/ips.c:6901 ips_init_phase1() warn: returning -1 instead of -ENOMEM is sloppy.
Reported-by Abaci Robot <[email protected]>
Fixes dd00cc486ab1 ("some kmalloc/memset ->kzalloc (tree wide)")
Signed-off-by chongjiapeng <[email protected]>
--- drivers/scsi/ips.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ips.c +1 -1
@@ -6898,7 +6898,7 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr)if (ha ==NULL ) {IPS_PRINTK (KERN_WARNING , pci_dev,"Unable to allocate temporary ha struct\n" ); -return -1 ; +return -ENOMEM ; } ips_sh[index] =NULL ;
Signature · 1 line
2.19.1.6.gb485710b
Quoted 6 lines · Jiapeng Chong
From: chongjiapeng <[email protected]>
Fixes the following smatch warning:
drivers/scsi/ips.c:6901ips_init_phase1()warn: returning -1 instead of-ENOMEMis sloppy.
Really, like megaraid, it's not. ips_init_phase1() returns either Success or -1. If it returns -1, that gets translated to -ENODEV so, again, we'd lose this nuanced return completely.
James