Re: [PATCH] ntb_perf: Fix an error code in perf_copy_chunk()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 23, 2018 at 11:33:56AM +0300, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
> We accidentally return success if dmaengine_submit() fails.  The fix is
> to preserve the error code from dma_submit_error().
> 

Yep, absolutely right. Thanks!

Acked-by: Serge Semin <fancer.lancer@xxxxxxxxx>

> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> 
> diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
> index 8de72f3fba4d..387e685063fc 100644
> --- a/drivers/ntb/test/ntb_perf.c
> +++ b/drivers/ntb/test/ntb_perf.c
> @@ -828,7 +828,8 @@ static int perf_copy_chunk(struct perf_thread *pthr,
>  	tx->callback_param = pthr;
>  	dma_set_unmap(tx, unmap);
>  
> -	if (dma_submit_error(dmaengine_submit(tx))) {
> +	ret = dma_submit_error(dmaengine_submit(tx));
> +	if (ret) {
>  		dmaengine_unmap_put(unmap);
>  		goto err_free_resource;
>  	}
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux