summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2008-07-24 06:29:04 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 19:47:26 +0200
commit4c432a8f0134504814aa8dcce6cc57c89d175604 (patch)
treeebc15ff444ec24098c18ec6c0210ea33333f40d3 /scripts
parentcheckpatch: condition/loop indent checks (diff)
downloadlinux-4c432a8f0134504814aa8dcce6cc57c89d175604.tar.xz
linux-4c432a8f0134504814aa8dcce6cc57c89d175604.zip
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>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 13d7a330b5dd..a4e8087a0cae 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2078,6 +2078,13 @@ sub process {
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
# if ($line =~ /^.\s*\#\s*if(|n)def/ && ($realfile =~ /\.c$/)) {