2012-10-31 11:22:44

by Zefir Kurtisi

[permalink] [raw]
Subject: [PATCH] ath9k: fix memory leak in DFS pattern detector

Free instance of pattern detector if requested DFS domain is
not supported.

Signed-off-by: Zefir Kurtisi <[email protected]>
---
.../net/wireless/ath/ath9k/dfs_pattern_detector.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

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);
--
1.7.4.1