* [PATCH v3] staging: kpc2000: remove unnecessary assertions in kpc_dma_transfer
@ 2019-12-19 17:21 Aditya Pakki
0 siblings, 0 replies; only message in thread
From: Aditya Pakki @ 2019-12-19 17:21 UTC (permalink / raw)
To: pakki001
Cc: devel, Vandana BN, Greg Kroah-Hartman, kjlu, linux-kernel,
Madhumitha Prabakaran, Max Filippov, Simon Sandström,
Dan Carpenter
In kpc_dma_transfer(), the assertion that priv is NULL and priv->ldev
is NULL, are never satisfied. The two callers of the function,
dereference the fields before the function is called. This patch
removes the two BUG_ON calls.
Signed-off-by: Aditya Pakki <pakki001@umn.edu>
---
v2: Also remove BUG_ON call for ldev, suggested by Greg.
v1: Replace the recovery code by removing the assertion, as suggested
by Greg Kroah-Hartman.
---
drivers/staging/kpc2000/kpc_dma/fileops.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/staging/kpc2000/kpc_dma/fileops.c b/drivers/staging/kpc2000/kpc_dma/fileops.c
index cb52bd9a6d2f..40525540dde6 100644
--- a/drivers/staging/kpc2000/kpc_dma/fileops.c
+++ b/drivers/staging/kpc2000/kpc_dma/fileops.c
@@ -49,9 +49,7 @@ 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);
acd = kzalloc(sizeof(*acd), GFP_KERNEL);
if (!acd) {
--
2.20.1
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-12-19 17:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-19 17:21 [PATCH v3] staging: kpc2000: remove unnecessary assertions in kpc_dma_transfer Aditya Pakki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).