diff mbox

ath9k: fix memory leak in DFS pattern detector

Message ID 1351682554-30645-1-git-send-email-zefir.kurtisi@neratec.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Zefir Kurtisi Oct. 31, 2012, 11:22 a.m. UTC
Free instance of pattern detector if requested DFS domain is
not supported.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
---
 .../net/wireless/ath/ath9k/dfs_pattern_detector.c  |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c
index f66da35d..3b12914 100644
--- a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c
+++ b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c
@@ -295,6 +295,7 @@  dfs_pattern_detector_init(enum nl80211_dfs_regions region)
 		return dpd;
 
 	pr_err("Could not set DFS domain to %d. ", region);
+	kfree(dpd);
 	return NULL;
 }
 EXPORT_SYMBOL(dfs_pattern_detector_init);