Search Linux Wireless

[PATCH] mac80211: fix possible memory leak in ieee80211_register_hw()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Before return, free allocated memory in this function.

Signed-off-by: ZHAO Gang <gamerh2o@xxxxxxxxx>
---
 net/mac80211/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 2bd5b55..7ee0e8a 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -876,8 +876,10 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 
 		for (j = 0; j < c->n_limits; j++)
 			if ((c->limits[j].types & BIT(NL80211_IFTYPE_ADHOC)) &&
-			    c->limits[j].max > 1)
+			    c->limits[j].max > 1) {
+				kfree(local->int_scan_req);
 				return -EINVAL;
+			}
 	}
 
 #ifndef CONFIG_MAC80211_MESH
-- 
1.8.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux