summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2016-10-31 16:04:10 +0100
committerTejun Heo <tj@kernel.org>2016-10-31 17:28:08 +0100
commit18eddaedc940a49425364df98abda218ce1e771c (patch)
tree224fc5a5e32e8b6f749fa44218786a76883a48c6
parentahci: fix the single MSI-X case in ahci_init_one (diff)
downloadlinux-18eddaedc940a49425364df98abda218ce1e771c.tar.xz
linux-18eddaedc940a49425364df98abda218ce1e771c.zip
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>
-rw-r--r--drivers/scsi/mvsas/mv_sas.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c
index 86eb19902bac..c7cc8035eacb 100644
--- a/drivers/scsi/mvsas/mv_sas.c
+++ b/drivers/scsi/mvsas/mv_sas.c
@@ -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;