mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
arch/mn10300/mm: eliminate NULL dereference
dev_name always dereferences its argument, so it should not be called if the argument is NULL. The function indeed later tests the argument for being NULL. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression dev,E; @@ *dev_name(dev) ... when != dev = E ( *dev == NULL | *dev != NULL ) // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: David Howells <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
dc4c26bfed
commit
6e0c64f4dd
1 changed files with 2 additions and 1 deletions
|
|
@ -25,7 +25,8 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
|
|||
unsigned long addr;
|
||||
void *ret;
|
||||
|
||||
printk("dma_alloc_coherent(%s,%zu,,%x)\n", dev_name(dev), size, gfp);
|
||||
pr_debug("dma_alloc_coherent(%s,%zu,%x)\n",
|
||||
dev ? dev_name(dev) : "?", size, gfp);
|
||||
|
||||
if (0xbe000000 - pci_sram_allocated >= size) {
|
||||
size = (size + 255) & ~255;
|
||||
|
|
|
|||
Loading…
Reference in a new issue