4 if [[ "$file" = "" ]] ; then
5 echo "Usage: $0 <file with smatch messages>"
12 for line
in $
(grep 'dereferenced before' $file) ; do
14 code_file
=$
(echo "$line" | cut
-d ':' -f1)
15 lineno
=$
(echo "$line" | cut
-d ' ' -f1 | cut
-d ':' -f2)
16 function=$
(echo "$line" | cut
-d ' ' -f2)
17 variable
=$
(echo "$line" | cut
-d "'" -f3)
18 source_line
=$
(tail -n +$lineno $code_file |
head -n 1 |
sed -e 's/^\W*//')
20 if echo "$source_line" |
grep -q rcu_assign_pointer
; then
23 if echo "$source_line" |
grep -q '^\W*tda_' ; then
26 if echo "$source_line" |
grep -q tda_fail
; then
29 if echo "$source_line" |
grep -q '^\W*ATH5K_' ; then
32 if echo "$source_line" |
grep -qw CMDINFO
; then
35 if echo "$source_line" |
grep -qw dump_desc_dbg
; then
38 if echo "$source_line" |
grep -qw CAMERA_IS_OPERATIONAL
; then
41 if echo "$source_line" |
grep -qw USBVISION_IS_OPERATIONAL
; then
44 if echo "$source_line" |
grep -qw DEV_INIT_TEST_WITH_RETURN
; then
47 if echo "$source_line" |
grep -qw TW_PRINTK
; then
50 if echo "$source_line" |
grep -qw RESET_ONE_SEC_TX_CNT
; then
53 if echo "$source_line" |
grep -qw SOCK_DEBUG
; then
56 if echo "$source_line" |
grep -qw P80211SKB_RXMETA
; then
59 if echo "$source_line" |
grep -qw ACM_READY
; then
62 if echo "$source_line" |
grep -qw v4l2_subdev_notify
; then
65 if echo "$source_line" |
egrep -qw 'tuner_(err|info)' ; then
68 if echo "$source_line" |
grep -qw DBG_SKB
; then
71 if echo "$source_line" |
grep -qw for_each_mddev
; then
74 if echo "$source_line" |
grep -qw v4l2_subdev_call
; then
77 if echo "$source_line" |
grep -qw VALID_CALLBACK
; then
80 if [ "$variable" == "bp->dev" ] && echo "$source_line" |
grep -qw DP
; then
83 if echo "$source_line" |
grep -qw BNX2X_ERR
; then
86 if echo "$source_line" |
grep -qw FCOE_NETDEV_DBG
; then
89 if echo "$source_line" |
grep -qw __rq_for_each_bio
; then
92 if echo "$source_line" |
grep -qw IPS_DMA_DIR
; then
95 if [ "$variable" == "dev" ] && echo "$source_line" |
grep -qw dprintk
; then
99 echo "$code_file:$lineno $function '$variable': $source_line"