]> git.baikalelectronics.ru Git - kernel.git/commit
arch/mn10300/mm: eliminate NULL dereference
authorJulia Lawall <julia@diku.dk>
Mon, 23 Aug 2010 13:31:34 +0000 (14:31 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 23 Aug 2010 18:41:24 +0000 (11:41 -0700)
commit9ed7106a9bde26a8cc4b9c7434d8b168e33d0d85
tree581e5a5bf54f854be60ba1c69fd400589c307bcb
parent609e2a43575d4692a3b3e35a0f94f8d7d4def91a
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 <julia@diku.dk>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/mn10300/mm/dma-alloc.c