lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1634640655-20667-1-git-send-email-jiapeng.chong@linux.alibaba.com>
Date:   Tue, 19 Oct 2021 18:50:55 +0800
From:   Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
To:     aacraid@...rosemi.com
Cc:     jejb@...ux.ibm.com, martin.petersen@...cle.com,
        linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
        chongjiapeng <jiapeng.chong@...ux.alibaba.com>
Subject: [PATCH] scsi: core: return -ENOMEM on ips_init_phase1() allocation failure

From: chongjiapeng <jiapeng.chong@...ux.alibaba.com>

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 <abaci@...ux.alibaba.com>
Fixes: dd00cc486ab1 ("some kmalloc/memset ->kzalloc (tree wide)")
Signed-off-by: chongjiapeng <jiapeng.chong@...ux.alibaba.com>
---
 drivers/scsi/ips.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index 498bf04499ce..2ce97f407d18 100644
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -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;
-- 
2.19.1.6.gb485710b

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ