From: Lennert Buytenhek Date: Sat, 2 Jan 2010 09:31:42 +0000 (+0100) Subject: mwl8k: fix configure_filter() memory leak on error X-Git-Tag: v2.6.33~5^2~1^2~43 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=90852f7aed0f90d443efd7e0f9b82d8ac8186848;p=profile%2Fcommon%2Fkernel-common.git mwl8k: fix configure_filter() memory leak on error 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 Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index 59d4915..59f9210 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c @@ -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);