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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20191219171141.GA2068060@kroah.com>
Date:   Thu, 19 Dec 2019 18:11:41 +0100
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Aditya Pakki <pakki001@....edu>
Cc:     Bharath Vedartham <linux.bhar@...il.com>,
        Vandana BN <bnvandana@...il.com>, kjlu@....edu,
        linux-kernel@...r.kernel.org,
        Madhumitha Prabakaran <madhumithabiw@...il.com>,
        Harsh Jain <harshjain32@...il.com>,
        Simon Sandström <simon@...anor.nu>,
        devel@...verdev.osuosl.org
Subject: Re: [PATCH v2] staging: kpc2000: remove unnecessary assertion on priv

On Tue, Dec 17, 2019 at 04:58:24PM -0600, Aditya Pakki wrote:
> In kpc_dma_transfer(), the assertion that priv is NULL is never
> satisfied. The two callers of the function, dereference the priv
> pointer before the call is executed. This patch removes the
> unnecessary BUG_ON call.
> 
> Signed-off-by: Aditya Pakki <pakki001@....edu>
> ---
> v1: Replace the recovery code by removing the assertion, as suggested
> by Greg Kroah-Hartman.
> ---
>  drivers/staging/kpc2000/kpc_dma/fileops.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/staging/kpc2000/kpc_dma/fileops.c b/drivers/staging/kpc2000/kpc_dma/fileops.c
> index cb52bd9a6d2f..61d762535823 100644
> --- a/drivers/staging/kpc2000/kpc_dma/fileops.c
> +++ b/drivers/staging/kpc2000/kpc_dma/fileops.c
> @@ -49,7 +49,6 @@ static int kpc_dma_transfer(struct dev_private_data *priv,
>  	u64 dma_addr;
>  	u64 user_ctl;
>  
> -	BUG_ON(priv == NULL);
>  	ldev = priv->ldev;
>  	BUG_ON(ldev == NULL);

ldev is also obviously never NULL so you can remove that at the same
time.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ