* [PATCH] sbp-target: Delete an error message for a failed memory allocation in three functions
@ 2017-12-10 19:10 SF Markus Elfring
2017-12-10 21:51 ` Chris Boot
0 siblings, 1 reply; 2+ messages in thread
From: SF Markus Elfring @ 2017-12-10 19:10 UTC (permalink / raw)
To: target-devel, linux-scsi, linux1394-devel, Chris Boot,
Nicholas A. Bellinger
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 10 Dec 2017 19:54:11 +0100
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@users.sourceforge.net>
---
drivers/target/sbp/sbp_target.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c
index e5c3e5f827d0..fb1003921d85 100644
--- a/drivers/target/sbp/sbp_target.c
+++ b/drivers/target/sbp/sbp_target.c
@@ -201,10 +201,9 @@ static struct sbp_session *sbp_session_create(
snprintf(guid_str, sizeof(guid_str), "%016llx", guid);
sess = kmalloc(sizeof(*sess), GFP_KERNEL);
- if (!sess) {
- pr_err("failed to allocate session descriptor\n");
+ if (!sess)
return ERR_PTR(-ENOMEM);
- }
+
spin_lock_init(&sess->lock);
INIT_LIST_HEAD(&sess->login_list);
INIT_DELAYED_WORK(&sess->maint_work, session_maintenance_work);
@@ -2029,10 +2028,8 @@ static struct se_portal_group *sbp_make_tpg(
}
tpg = kzalloc(sizeof(*tpg), GFP_KERNEL);
- if (!tpg) {
- pr_err("Unable to allocate struct sbp_tpg\n");
+ if (!tpg)
return ERR_PTR(-ENOMEM);
- }
tpg->tport = tport;
tpg->tport_tpgt = tpgt;
@@ -2088,10 +2085,8 @@ static struct se_wwn *sbp_make_tport(
return ERR_PTR(-EINVAL);
tport = kzalloc(sizeof(*tport), GFP_KERNEL);
- if (!tport) {
- pr_err("Unable to allocate struct sbp_tport\n");
+ if (!tport)
return ERR_PTR(-ENOMEM);
- }
tport->guid = guid;
sbp_format_wwn(tport->tport_name, SBP_NAMELEN, guid);
--
2.15.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] sbp-target: Delete an error message for a failed memory allocation in three functions
2017-12-10 19:10 [PATCH] sbp-target: Delete an error message for a failed memory allocation in three functions SF Markus Elfring
@ 2017-12-10 21:51 ` Chris Boot
0 siblings, 0 replies; 2+ messages in thread
From: Chris Boot @ 2017-12-10 21:51 UTC (permalink / raw)
To: SF Markus Elfring, target-devel, linux-scsi, linux1394-devel,
Chris Boot, Nicholas A. Bellinger
Cc: LKML, kernel-janitors
On 10/12/2017 19:10, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 10 Dec 2017 19:54:11 +0100
>
> 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@users.sourceforge.net>
[snip]
Looks good to me.
Acked-by: Chris Boot <bootc@boo.tc>
Thanks,
Chris
--
Chris Boot
bootc@boo.tc
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-12-10 21:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-10 19:10 [PATCH] sbp-target: Delete an error message for a failed memory allocation in three functions SF Markus Elfring
2017-12-10 21:51 ` Chris Boot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).