diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-14 17:17:29 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-25 00:16:33 -0400 |
commit | c2010a3b9e5e98efb7f70d4d73ce4f15508ffa7b (patch) | |
tree | 06914ffe07b6d06e8443b753485565e8b4cc93b2 /scripts/checkpatch.pl | |
parent | 9214d1d80c19016172e685ce7bde0ea757c49097 (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/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 58a94947d655..64ec4b8a51b5 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -1889,6 +1889,13 @@ sub process { | |||
1889 | WARN("kfree(NULL) is safe this check is probabally not required\n" . $hereprev); | 1889 | WARN("kfree(NULL) is safe this check is probabally not required\n" . $hereprev); |
1890 | } | 1890 | } |
1891 | } | 1891 | } |
1892 | # check for needless usb_free_urb() checks | ||
1893 | if ($prevline =~ /\bif\s*\(([^\)]*)\)/) { | ||
1894 | my $expr = $1; | ||
1895 | if ($line =~ /\busb_free_urb\(\Q$expr\E\);/) { | ||
1896 | WARN("usb_free_urb(NULL) is safe this check is probabally not required\n" . $hereprev); | ||
1897 | } | ||
1898 | } | ||
1892 | 1899 | ||
1893 | # warn about #ifdefs in C files | 1900 | # warn about #ifdefs in C files |
1894 | # if ($line =~ /^.#\s*if(|n)def/ && ($realfile =~ /\.c$/)) { | 1901 | # if ($line =~ /^.#\s*if(|n)def/ && ($realfile =~ /\.c$/)) { |