mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
checkpatch: usb_free_urb() can take NULL
usb_free_urb() can take a NULL, so let's check and warn about that. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
f5fe35dd95
commit
4c432a8f01
1 changed files with 7 additions and 0 deletions
|
@ -2078,6 +2078,13 @@ sub process {
|
||||||
WARN("kfree(NULL) is safe this check is probabally not required\n" . $hereprev);
|
WARN("kfree(NULL) is safe this check is probabally not required\n" . $hereprev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
# check for needless usb_free_urb() checks
|
||||||
|
if ($prevline =~ /\bif\s*\(([^\)]*)\)/) {
|
||||||
|
my $expr = $1;
|
||||||
|
if ($line =~ /\busb_free_urb\(\Q$expr\E\);/) {
|
||||||
|
WARN("usb_free_urb(NULL) is safe this check is probably not required\n" . $hereprev);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# warn about #ifdefs in C files
|
# warn about #ifdefs in C files
|
||||||
# if ($line =~ /^.\s*\#\s*if(|n)def/ && ($realfile =~ /\.c$/)) {
|
# if ($line =~ /^.\s*\#\s*if(|n)def/ && ($realfile =~ /\.c$/)) {
|
||||||
|
|
Loading…
Reference in a new issue