summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2008-04-14 14:17:29 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2008-04-24 21:16:33 -0700
commitc2010a3b9e5e98efb7f70d4d73ce4f15508ffa7b (patch)
tree06914ffe07b6d06e8443b753485565e8b4cc93b2 /scripts
parent9214d1d80c19016172e685ce7bde0ea757c49097 (diff)
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>
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 58a94947d65..64ec4b8a51b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1889,6 +1889,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 probabally not required\n" . $hereprev);
+ }
+ }
# warn about #ifdefs in C files
# if ($line =~ /^.#\s*if(|n)def/ && ($realfile =~ /\.c$/)) {