Skip to content
Commit 6e0c64f4 authored by Julia Lawall's avatar Julia Lawall Committed by Linus Torvalds
Browse files

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: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent dc4c26bf
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment