提交 94c78cb4 编写于 作者: J Johannes Berg

mac80211: fix memory leak

My recent change here introduced a possible memory leak if the
driver registers an invalid cipher schemes. This won't really
happen in practice, but fix the leak nonetheless.

Fixes: e3a55b53 ("mac80211: validate cipher scheme PN length better")
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 658358ce
...@@ -770,8 +770,10 @@ static int ieee80211_init_cipher_suites(struct ieee80211_local *local) ...@@ -770,8 +770,10 @@ static int ieee80211_init_cipher_suites(struct ieee80211_local *local)
for (r = 0; r < local->hw.n_cipher_schemes; r++) { for (r = 0; r < local->hw.n_cipher_schemes; r++) {
suites[w++] = cs[r].cipher; suites[w++] = cs[r].cipher;
if (WARN_ON(cs[r].pn_len > IEEE80211_MAX_PN_LEN)) if (WARN_ON(cs[r].pn_len > IEEE80211_MAX_PN_LEN)) {
kfree(suites);
return -EINVAL; return -EINVAL;
}
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册