ath: Fix smatch warning
authorSujith Manoharan <c_manoha@qca.qualcomm.com>
Tue, 7 Oct 2014 04:44:36 +0000 (10:14 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 7 Oct 2014 18:48:37 +0000 (14:48 -0400)
drivers/net/wireless/ath/main.c:88 ath_printk()
 error: we previously assumed 'common->hw' could be null (see line 82)

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/main.c

index 83f47af19280de4c3cd0cdf528c997b3d149187d..338d723376043e78d813b1423f3c93e14cec820b 100644 (file)
@@ -79,13 +79,13 @@ void ath_printk(const char *level, const struct ath_common* common,
        vaf.fmt = fmt;
        vaf.va = &args;
 
-       if (common && common->hw && common->hw->wiphy)
+       if (common && common->hw && common->hw->wiphy) {
                printk("%sath: %s: %pV",
                       level, wiphy_name(common->hw->wiphy), &vaf);
-       else
+               trace_ath_log(common->hw->wiphy, &vaf);
+       } else {
                printk("%sath: %pV", level, &vaf);
-
-       trace_ath_log(common->hw->wiphy, &vaf);
+       }
 
        va_end(args);
 }