[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e33356c3b654db03030d371e38f02c6019e9c1a7.camel@sipsolutions.net>
Date: Wed, 18 Jan 2023 10:45:24 +0100
From: Johannes Berg <johannes@...solutions.net>
To: Zhengchao Shao <shaozhengchao@...wei.com>,
linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com
Cc: sara.sharon@...el.com, luciano.coelho@...el.com,
weiyongjun1@...wei.com, yuehaibing@...wei.com
Subject: Re: [PATCH v2] wifi: mac80211: fix memory leak in
ieee80211_register_hw()
On Fri, 2022-12-02 at 12:38 +0800, Zhengchao Shao wrote:
>
> --- a/net/mac80211/main.c
> +++ b/net/mac80211/main.c
> @@ -1326,6 +1326,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
> hw->rate_control_algorithm);
> rtnl_unlock();
> if (result < 0) {
> + ieee80211_txq_teardown_flows(local);
> wiphy_debug(local->hw.wiphy,
> "Failed to initialize rate control algorithm\n");
> goto fail_rate;
> @@ -1364,6 +1365,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
>
> sband = kmemdup(sband, sizeof(*sband), GFP_KERNEL);
> if (!sband) {
> + ieee80211_txq_teardown_flows(local);
> result = -ENOMEM;
> goto fail_rate;
> }
I don't understand - we have a fail_rate label here where we free
everything.
What if we get to fail_wiphy_register, don't we leak it in the same way?
johannes
Powered by blists - more mailing lists