https://github.com/torvalds/linux
Revision 0376d5b25ef11e9b6450ebae20781a32d8985170 authored by Julia Lawall on 19 July 2009, 05:26:35 UTC, committed by David S. Miller on 21 July 2009, 20:00:44 UTC
If the NULL test is necessary, then the dereference should be moved below
the NULL test.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
type T;
expression E,E1;
identifier i,fld;
statement S;
@@

- T i = E->fld;
+ T i;
  ... when != E=E1
      when != i
  if (E == NULL||...) S
+ i = E->fld;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0021195
History
Tip revision: 0376d5b25ef11e9b6450ebae20781a32d8985170 authored by Julia Lawall on 19 July 2009, 05:26:35 UTC
drivers/net: Move a dereference below a NULL test
Tip revision: 0376d5b
File Mode Size
Documentation
arch
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.gitignore -rw-r--r-- 945 bytes
.mailmap -rw-r--r-- 3.9 KB
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 91.7 KB
Kbuild -rw-r--r-- 2.4 KB
MAINTAINERS -rw-r--r-- 147.9 KB
Makefile -rw-r--r-- 53.9 KB
README -rw-r--r-- 17.0 KB
REPORTING-BUGS -rw-r--r-- 3.1 KB

README

back to top