From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Aditya Pakki <pakki001@umn.edu>
Cc: "Bharath Vedartham" <linux.bhar@gmail.com>,
"Vandana BN" <bnvandana@gmail.com>,
kjlu@umn.edu, linux-kernel@vger.kernel.org,
"Madhumitha Prabakaran" <madhumithabiw@gmail.com>,
"Harsh Jain" <harshjain32@gmail.com>,
"Simon Sandström" <simon@nikanor.nu>,
devel@driverdev.osuosl.org
Subject: Re: [PATCH v2] staging: kpc2000: remove unnecessary assertion on priv
Date: Thu, 19 Dec 2019 18:11:41 +0100 [thread overview]
Message-ID: <20191219171141.GA2068060@kroah.com> (raw)
In-Reply-To: <20191217225830.4018-1-pakki001@umn.edu>
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@umn.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
prev parent reply other threads:[~2019-12-19 17:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-17 22:58 Aditya Pakki
2019-12-19 17:11 ` Greg Kroah-Hartman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191219171141.GA2068060@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=bnvandana@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=harshjain32@gmail.com \
--cc=kjlu@umn.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux.bhar@gmail.com \
--cc=madhumithabiw@gmail.com \
--cc=pakki001@umn.edu \
--cc=simon@nikanor.nu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®