target: tcm_loop: Delete an error message for a failed memory allocation in four 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: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>hifive-unleashed-5.1
parent
e0f3d4c23e
commit
cd3fb32a72
|
@ -184,7 +184,6 @@ static int tcm_loop_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *sc)
|
||||||
|
|
||||||
tl_cmd = kmem_cache_zalloc(tcm_loop_cmd_cache, GFP_ATOMIC);
|
tl_cmd = kmem_cache_zalloc(tcm_loop_cmd_cache, GFP_ATOMIC);
|
||||||
if (!tl_cmd) {
|
if (!tl_cmd) {
|
||||||
pr_err("Unable to allocate struct tcm_loop_cmd\n");
|
|
||||||
set_host_byte(sc, DID_ERROR);
|
set_host_byte(sc, DID_ERROR);
|
||||||
sc->scsi_done(sc);
|
sc->scsi_done(sc);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -221,10 +220,8 @@ static int tcm_loop_issue_tmr(struct tcm_loop_tpg *tl_tpg,
|
||||||
}
|
}
|
||||||
|
|
||||||
tl_cmd = kmem_cache_zalloc(tcm_loop_cmd_cache, GFP_KERNEL);
|
tl_cmd = kmem_cache_zalloc(tcm_loop_cmd_cache, GFP_KERNEL);
|
||||||
if (!tl_cmd) {
|
if (!tl_cmd)
|
||||||
pr_err("Unable to allocate memory for tl_cmd\n");
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
|
||||||
|
|
||||||
init_completion(&tl_cmd->tmr_done);
|
init_completion(&tl_cmd->tmr_done);
|
||||||
|
|
||||||
|
@ -773,10 +770,8 @@ static int tcm_loop_make_nexus(
|
||||||
}
|
}
|
||||||
|
|
||||||
tl_nexus = kzalloc(sizeof(struct tcm_loop_nexus), GFP_KERNEL);
|
tl_nexus = kzalloc(sizeof(struct tcm_loop_nexus), GFP_KERNEL);
|
||||||
if (!tl_nexus) {
|
if (!tl_nexus)
|
||||||
pr_err("Unable to allocate struct tcm_loop_nexus\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
tl_nexus->se_sess = target_alloc_session(&tl_tpg->tl_se_tpg, 0, 0,
|
tl_nexus->se_sess = target_alloc_session(&tl_tpg->tl_se_tpg, 0, 0,
|
||||||
TARGET_PROT_DIN_PASS | TARGET_PROT_DOUT_PASS,
|
TARGET_PROT_DIN_PASS | TARGET_PROT_DOUT_PASS,
|
||||||
|
@ -1082,10 +1077,9 @@ static struct se_wwn *tcm_loop_make_scsi_hba(
|
||||||
int ret, off = 0;
|
int ret, off = 0;
|
||||||
|
|
||||||
tl_hba = kzalloc(sizeof(struct tcm_loop_hba), GFP_KERNEL);
|
tl_hba = kzalloc(sizeof(struct tcm_loop_hba), GFP_KERNEL);
|
||||||
if (!tl_hba) {
|
if (!tl_hba)
|
||||||
pr_err("Unable to allocate struct tcm_loop_hba\n");
|
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* Determine the emulated Protocol Identifier and Target Port Name
|
* Determine the emulated Protocol Identifier and Target Port Name
|
||||||
* based on the incoming configfs directory name.
|
* based on the incoming configfs directory name.
|
||||||
|
|
Loading…
Reference in New Issue