diff options
author | Julia Lawall <julia@diku.dk> | 2010-05-27 14:37:19 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-06-04 13:38:57 -0700 |
commit | c60e55f30a4dac15db51b398c3bd94e4cfbf743a (patch) | |
tree | 2eb8f149857dc0d52551532b8ebe4f8c8a7db7d3 /drivers/staging/dt3155 | |
parent | 0aa3f139cd5123ffb8f397b91d777635e9761c24 (diff) |
Staging: Eliminate a NULL pointer dereference
Eliminate a NULL or near NULL pointer dereference.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@r exists@
expression E,E1;
identifier f;
statement S1,S2,S3;
@@
if ((E == NULL && ...) || ...)
{
... when != if (...) S1 else S2
when != E = E1
* E->f
... when any
return ...;
}
else S3
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/dt3155')
-rw-r--r-- | drivers/staging/dt3155/allocator.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/staging/dt3155/allocator.c b/drivers/staging/dt3155/allocator.c index bd5adbc2a238..d33947b0378f 100644 --- a/drivers/staging/dt3155/allocator.c +++ b/drivers/staging/dt3155/allocator.c @@ -176,9 +176,7 @@ int allocator_free_dma(unsigned long address) prev = ptr; ptr = ptr->next; if (!ptr) { - printk(KERN_ERR ALL_MSG - "free_dma(0x%08lx) but add. not allocated\n", - ptr->address); + pr_err(ALL_MSG "free_dma but add. not allocated\n"); return -EINVAL; } PDEBUGG("freeing: %08lx (%li) next %08lx\n", ptr->address, ptr->size, |