ath9k: Fix a smatch warnings
authorLarry Finger <Larry.Finger@lwfinger.net>
Sat, 27 Aug 2011 18:56:00 +0000 (13:56 -0500)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 29 Aug 2011 19:33:03 +0000 (15:33 -0400)
Smatch shows the following warnings:

  CHECK   drivers/net/wireless/ath/ath9k/htc_drv_main.c
drivers/net/wireless/ath/ath9k/htc_drv_main.c +1315 ath9k_htc_configure_filter(27) warn: inconsistent returns mutex:&priv->mutex: locked (1303) unlocked (1315)

  CHECK   drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +3321 ar9300_eeprom_restore_internal(20) warn: returning -1 instead of -ENOMEM is sloppy

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
drivers/net/wireless/ath/ath9k/htc_drv_main.c

index 908463915b995e148cb256279631035ff1d4ff1b..cb4c32eaef61249e061a2c2c5b1f4970d3c9161d 100644 (file)
@@ -3318,7 +3318,7 @@ static int ar9300_eeprom_restore_internal(struct ath_hw *ah,
 
        word = kzalloc(2048, GFP_KERNEL);
        if (!word)
-               return -1;
+               return -ENOMEM;
 
        memcpy(mptr, &ar9300_default, mdata_size);
 
index 0248024da56aa927d070053e2f71b6b8027dc34f..b9de1511add96928ade0a7696a70a5d7bc018b70 100644 (file)
@@ -1300,6 +1300,7 @@ static void ath9k_htc_configure_filter(struct ieee80211_hw *hw,
        if (priv->op_flags & OP_INVALID) {
                ath_dbg(ath9k_hw_common(priv->ah), ATH_DBG_ANY,
                        "Unable to configure filter on invalid state\n");
+               mutex_unlock(&priv->mutex);
                return;
        }
        ath9k_htc_ps_wakeup(priv);