* [PATCH v2] staging: kpc2000: remove unnecessary assertion on priv
@ 2019-12-17 22:58 ` Aditya Pakki
0 siblings, 0 replies; 4+ messages in thread
From: Aditya Pakki @ 2019-12-17 22:58 UTC (permalink / raw)
To: pakki001
Cc: kjlu, Greg Kroah-Hartman, Vandana BN, Simon Sandström,
Madhumitha Prabakaran, Matt Sickler, Jeremy Sowden,
Bharath Vedartham, Harsh Jain, devel, linux-kernel
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);
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2] staging: kpc2000: remove unnecessary assertion on priv
@ 2019-12-17 22:58 ` Aditya Pakki
0 siblings, 0 replies; 4+ messages in thread
From: Aditya Pakki @ 2019-12-17 22:58 UTC (permalink / raw)
To: pakki001
Cc: Bharath Vedartham, Vandana BN, Greg Kroah-Hartman, kjlu,
linux-kernel, Madhumitha Prabakaran, Harsh Jain,
Simon Sandström, devel
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);
--
2.20.1
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] staging: kpc2000: remove unnecessary assertion on priv
2019-12-17 22:58 ` Aditya Pakki
@ 2019-12-19 17:11 ` Greg Kroah-Hartman
-1 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2019-12-19 17:11 UTC (permalink / raw)
To: Aditya Pakki
Cc: Bharath Vedartham, Vandana BN, kjlu, linux-kernel,
Madhumitha Prabakaran, Harsh Jain, Simon Sandström, devel
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] staging: kpc2000: remove unnecessary assertion on priv
@ 2019-12-19 17:11 ` Greg Kroah-Hartman
0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2019-12-19 17:11 UTC (permalink / raw)
To: Aditya Pakki
Cc: Bharath Vedartham, devel, Harsh Jain, Vandana BN, kjlu,
linux-kernel, Madhumitha Prabakaran, Simon Sandström
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
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-12-19 17:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-17 22:58 [PATCH v2] staging: kpc2000: remove unnecessary assertion on priv Aditya Pakki
2019-12-17 22:58 ` Aditya Pakki
2019-12-19 17:11 ` Greg Kroah-Hartman
2019-12-19 17:11 ` Greg Kroah-Hartman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.