mwl8k: fix configure_filter() memory leak on error
authorLennert Buytenhek <buytenh@wantstofly.org>
Sat, 2 Jan 2010 09:31:42 +0000 (10:31 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 4 Jan 2010 21:09:48 +0000 (16:09 -0500)
If there was an error acquiring the firmware lock in
mwl8k_configure_filter(), we would end up leaking the multicast
command packet prepared by mwl8k_prepare_multicast().

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwl8k.c

index 59d49159cf2acc1b7c0497d20a642cf762290393..59f92105b0c24880980af6339f6589f469eefa52 100644 (file)
@@ -3157,8 +3157,10 @@ static void mwl8k_configure_filter(struct ieee80211_hw *hw,
        /* Clear unsupported feature flags */
        *total_flags &= FIF_ALLMULTI | FIF_BCN_PRBRESP_PROMISC;
 
-       if (mwl8k_fw_lock(hw))
+       if (mwl8k_fw_lock(hw)) {
+               kfree(cmd);
                return;
+       }
 
        if (priv->sniffer_enabled) {
                mwl8k_enable_sniffer(hw, 0);