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>] [day] [month] [year] [list]
Date:   Fri, 25 Aug 2017 21:21:08 +0200
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     linux-scsi@...r.kernel.org,
        "James E. J. Bottomley" <jejb@...ux.vnet.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: [PATCH] SCSI-scan: Delete an error message for a failed memory
 allocation in two functions

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Fri, 25 Aug 2017 21:17:02 +0200

Omit an extra message for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 drivers/scsi/scsi_scan.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index fd88dabd599d..280ac20a644b 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -427,10 +427,9 @@ static struct scsi_target *scsi_alloc_target(struct device *parent,
 	int error, ref_got;
 
 	starget = kzalloc(size, GFP_KERNEL);
-	if (!starget) {
-		printk(KERN_ERR "%s: allocation failure\n", __func__);
+	if (!starget)
 		return NULL;
-	}
+
 	dev = &starget->dev;
 	device_initialize(dev);
 	kref_init(&starget->reap_ref);
@@ -1340,10 +1339,8 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
 retry:
 	lun_data = kmalloc(length, GFP_KERNEL |
 			   (sdev->host->unchecked_isa_dma ? __GFP_DMA : 0));
-	if (!lun_data) {
-		printk(ALLOC_FAILURE_MSG, __func__);
+	if (!lun_data)
 		goto out;
-	}
 
 	scsi_cmd[0] = REPORT_LUNS;
 
-- 
2.14.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ