mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] SCSI-devinfo: Delete an error message for a failed memory allocation in scsi_dev_info_list_add_keyed()
@ 2017-08-25 19:00 SF Markus Elfring
  0 siblings, 0 replies; only message in thread
From: SF Markus Elfring @ 2017-08-25 19:00 UTC (permalink / raw)
  To: linux-scsi, James E. J. Bottomley, Martin K. Petersen
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 25 Aug 2017 20:54:16 +0200

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/scsi/scsi_devinfo.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index 28fea83ae2fe..3009934b95a7 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -369,10 +369,8 @@ int scsi_dev_info_list_add_keyed(int compatible, char *vendor, char *model,
 		return PTR_ERR(devinfo_table);
 
 	devinfo = kmalloc(sizeof(*devinfo), GFP_KERNEL);
-	if (!devinfo) {
-		printk(KERN_ERR "%s: no memory\n", __func__);
+	if (!devinfo)
 		return -ENOMEM;
-	}
 
 	scsi_strcpy_devinfo("vendor", devinfo->vendor, sizeof(devinfo->vendor),
 			    vendor, compatible);
-- 
2.14.0

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-08-25 19:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-25 19:00 [PATCH] SCSI-devinfo: Delete an error message for a failed memory allocation in scsi_dev_info_list_add_keyed() SF Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®