Search Linux Wireless

[PATCH] nl80211: avoid possible memleak on nl80211_set_reg

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

 



Setting NULL just after freeing regdomain.

Signed-off-by: Eduardo Abinader <eduardo.abinader@xxxxxxxxxxxx>
---
 net/wireless/nl80211.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index d120449..39d107d 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5839,10 +5839,11 @@ static int nl80211_set_reg(struct sk_buff *skb, struct genl_info *info)
 
 	r = set_regdom(rd, REGD_SOURCE_CRDA);
 	/* set_regdom took ownership */
-	rd = NULL;
 
  bad_reg:
 	kfree(rd);
+	rd = NULL;
+
 	return r;
 }
 #endif /* CONFIG_CFG80211_CRDA_SUPPORT */
-- 
2.5.0

--
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