From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-scsi@vger.kernel.org, Doug Gilbert <dgilbert@interlog.com>,
"James E. J. Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 1/3] SCSI-sg: Delete an error message for a failed memory allocation in sg_alloc()
Date: Fri, 25 Aug 2017 20:23:56 +0000 [thread overview]
Message-ID: <a5815434-a4b8-66bf-f5ff-264b8310ac9d@users.sourceforge.net> (raw)
In-Reply-To: <0fffccee-7cc1-1321-2c6b-00ac06b304b8@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 25 Aug 2017 21:48:11 +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/sg.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index d7ff71e0c85c..8ca10a2fc1a0 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1404,11 +1404,8 @@ sg_alloc(struct gendisk *disk, struct scsi_device *scsidp)
u32 k;
sdp = kzalloc(sizeof(Sg_device), GFP_KERNEL);
- if (!sdp) {
- sdev_printk(KERN_WARNING, scsidp, "%s: kmalloc Sg_device "
- "failure\n", __func__);
+ if (!sdp)
return ERR_PTR(-ENOMEM);
- }
idr_preload(GFP_KERNEL);
write_lock_irqsave(&sg_index_lock, iflags);
--
2.14.0
next prev parent reply other threads:[~2017-08-25 20:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-25 20:22 [PATCH 0/3] SCSI-sg: Adjustments for two function implementations SF Markus Elfring
2017-08-25 20:23 ` SF Markus Elfring [this message]
2017-08-25 20:25 ` [PATCH 2/3] SCSI-sg: Improve a size determination in sg_alloc() SF Markus Elfring
2017-08-25 20:26 ` [PATCH 3/3] SCSI-sg: Fix a typo in a comment line in sg_ioctl() SF Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a5815434-a4b8-66bf-f5ff-264b8310ac9d@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=dgilbert@interlog.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox