On 31/10/16 15:04, Wei Yongjun wrote:
> From: Wei Yongjun <[email protected]>
> 
> 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 <[email protected]>
> ---
>  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
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to