Skip to content

Commit 18eddae

Browse files
Wei Yongjunhtejun
authored andcommitted
mvsas: fix error return code in mvs_task_prep()
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>
1 parent 0ce57f8 commit 18eddae

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/scsi/mvsas/mv_sas.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,8 +791,10 @@ static int mvs_task_prep(struct sas_task *task, struct mvs_info *mvi, int is_tmf
791791
slot->slot_tag = tag;
792792

793793
slot->buf = pci_pool_alloc(mvi->dma_pool, GFP_ATOMIC, &slot->buf_dma);
794-
if (!slot->buf)
794+
if (!slot->buf) {
795+
rc = -ENOMEM;
795796
goto err_out_tag;
797+
}
796798
memset(slot->buf, 0, MVS_SLOT_BUF_SZ);
797799

798800
tei.task = task;

0 commit comments

Comments
 (0)