https://github.com/torvalds/linux
Revision 48f125ce1cc3ff275f9587b5bf56bf0f90766c7d authored by Julia Lawall on 29 August 2012, 06:49:12 UTC, committed by David S. Miller on 31 August 2012, 20:27:48 UTC
Initialize return variable before exiting on an error path.

The initial initialization of the return variable is also dropped, because
that value is never used.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}

// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent fa026e2
History
Tip revision: 48f125ce1cc3ff275f9587b5bf56bf0f90766c7d authored by Julia Lawall on 29 August 2012, 06:49:12 UTC
net: ipv6: fix error return code
Tip revision: 48f125c
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-- 1014 bytes
.mailmap -rw-r--r-- 4.4 KB
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 92.7 KB
Kbuild -rw-r--r-- 2.5 KB
Kconfig -rw-r--r-- 252 bytes
MAINTAINERS -rw-r--r-- 210.7 KB
Makefile -rw-r--r-- 46.1 KB
README -rw-r--r-- 17.3 KB
REPORTING-BUGS -rw-r--r-- 3.3 KB

README

back to top