* [PATCH] mvsas: fix error return code in mvs_task_prep()
@ 2016-10-31 15:04 Wei Yongjun
2016-10-31 15:13 ` Luis de Bethencourt
2016-10-31 16:29 ` Tejun Heo
0 siblings, 2 replies; 4+ messages in thread
From: Wei Yongjun @ 2016-10-31 15:04 UTC (permalink / raw)
To: James E . J . Bottomley, Martin K. Petersen, Wilfried Weissmann,
Luis de Bethencourt, Johannes Thumshirn, Hannes Reinecke,
Tejun Heo, Baoyou Xie
Cc: Wei Yongjun, linux-scsi
From: Wei Yongjun <weiyongjun1@huawei.com>
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>
---
drivers/scsi/mvsas/mv_sas.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c
index 86eb199..c7cc803 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;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mvsas: fix error return code in mvs_task_prep()
2016-10-31 15:04 [PATCH] mvsas: fix error return code in mvs_task_prep() Wei Yongjun
@ 2016-10-31 15:13 ` Luis de Bethencourt
2016-10-31 16:29 ` Tejun Heo
1 sibling, 0 replies; 4+ messages in thread
From: Luis de Bethencourt @ 2016-10-31 15:13 UTC (permalink / raw)
To: Wei Yongjun, James E . J . Bottomley, Martin K. Petersen,
Wilfried Weissmann, Johannes Thumshirn, Hannes Reinecke,
Tejun Heo, Baoyou Xie
Cc: Wei Yongjun, linux-scsi
On 31/10/16 15:04, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> 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>
> ---
> drivers/scsi/mvsas/mv_sas.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c
> index 86eb199..c7cc803 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;
>
Looks good to me.
This will make the rc in dev_printk() and prep_out correct.
Thanks,
Luis
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mvsas: fix error return code in mvs_task_prep()
2016-10-31 15:04 [PATCH] mvsas: fix error return code in mvs_task_prep() Wei Yongjun
2016-10-31 15:13 ` Luis de Bethencourt
@ 2016-10-31 16:29 ` Tejun Heo
2016-11-01 17:36 ` Tejun Heo
1 sibling, 1 reply; 4+ messages in thread
From: Tejun Heo @ 2016-10-31 16:29 UTC (permalink / raw)
To: Wei Yongjun
Cc: James E . J . Bottomley, Martin K. Petersen, Wilfried Weissmann,
Luis de Bethencourt, Johannes Thumshirn, Hannes Reinecke,
Baoyou Xie, Wei Yongjun, linux-scsi
On Mon, Oct 31, 2016 at 03:04:10PM +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> 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>
Applied to libata/for-4.9-fixes.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mvsas: fix error return code in mvs_task_prep()
2016-10-31 16:29 ` Tejun Heo
@ 2016-11-01 17:36 ` Tejun Heo
0 siblings, 0 replies; 4+ messages in thread
From: Tejun Heo @ 2016-11-01 17:36 UTC (permalink / raw)
To: Wei Yongjun
Cc: James E . J . Bottomley, Martin K. Petersen, Wilfried Weissmann,
Luis de Bethencourt, Johannes Thumshirn, Hannes Reinecke,
Baoyou Xie, Wei Yongjun, linux-scsi
On Mon, Oct 31, 2016 at 10:29:26AM -0600, Tejun Heo wrote:
> On Mon, Oct 31, 2016 at 03:04:10PM +0000, Wei Yongjun wrote:
> > From: Wei Yongjun <weiyongjun1@huawei.com>
> >
> > 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>
>
> Applied to libata/for-4.9-fixes.
I messed up. This should have gone through scsi, not libata. Chatted
with Martin and as the patch is a small obvious fix decided to leave
it in libata tree. My apologies for the confusion.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-11-01 17:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-31 15:04 [PATCH] mvsas: fix error return code in mvs_task_prep() Wei Yongjun
2016-10-31 15:13 ` Luis de Bethencourt
2016-10-31 16:29 ` Tejun Heo
2016-11-01 17:36 ` Tejun Heo
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.