Skip to content

Commit

Permalink
mvsas: fix error return code in mvs_task_prep()
Browse files Browse the repository at this point in the history
Fix to return error code -ENOMEM from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Wei Yongjun authored and Tejun Heo committed Oct 31, 2016
1 parent 0ce57f8 commit 18eddae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/scsi/mvsas/mv_sas.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,8 +791,10 @@ static int mvs_task_prep(struct sas_task *task, struct mvs_info *mvi, int is_tmf
slot->slot_tag = tag;

slot->buf = pci_pool_alloc(mvi->dma_pool, GFP_ATOMIC, &slot->buf_dma);
if (!slot->buf)
if (!slot->buf) {
rc = -ENOMEM;
goto err_out_tag;
}
memset(slot->buf, 0, MVS_SLOT_BUF_SZ);

tei.task = task;
Expand Down

0 comments on commit 18eddae

Please sign in to comment.