Commit e0f3d4c2 authored by Markus Elfring's avatar Markus Elfring Committed by Nicholas Bellinger

sbp-target: Delete an error message for a failed memory allocation in three functions

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

This issue was detected by using the Coccinelle software.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Acked-by: default avatarChris Boot <bootc@boo.tc>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 80eb8761
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment