lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200514022935.GE29933@yilunxu-OptiPlex-7050>
Date:   Thu, 14 May 2020 10:29:35 +0800
From:   Xu Yilun <yilun.xu@...el.com>
To:     Souptick Joarder <jrdr.linux@...il.com>
Cc:     hao.wu@...el.com, mdf@...nel.org, linux-fpga@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fpga: dfl: afu: Corrected error handling levels

The patch looks good to me.

Maybe we could add the Fixes tag:
  Fixes: fa8dda1edef9 (fpga: dfl: afu: add DFL_FPGA_PORT_DMA_MAP/UNMAP ioctls support)

Thanks,
Yilun

On Thu, May 14, 2020 at 12:52:05AM +0530, Souptick Joarder wrote:
> Corrected error handling goto sequnece. Level put_pages should
> be called when pinned pages >= 0 && pinned != npages. Level
> free_pages should be called when pinned pages < 0.
> 
> Signed-off-by: Souptick Joarder <jrdr.linux@...il.com>
> ---
>  drivers/fpga/dfl-afu-dma-region.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/fpga/dfl-afu-dma-region.c b/drivers/fpga/dfl-afu-dma-region.c
> index 62f9244..5942343 100644
> --- a/drivers/fpga/dfl-afu-dma-region.c
> +++ b/drivers/fpga/dfl-afu-dma-region.c
> @@ -61,10 +61,10 @@ static int afu_dma_pin_pages(struct dfl_feature_platform_data *pdata,
>  				     region->pages);
>  	if (pinned < 0) {
>  		ret = pinned;
> -		goto put_pages;
> +		goto free_pages;
>  	} else if (pinned != npages) {
>  		ret = -EFAULT;
> -		goto free_pages;
> +		goto put_pages;
>  	}
>  
>  	dev_dbg(dev, "%d pages pinned\n", pinned);
> -- 
> 1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ