Message ID | 20221203020903.383235-1-shaozhengchao@huawei.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 23353efc26e98b61b925274ecbb8f0610f69a8aa |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: wwan: iosm: fix memory leak in ipc_mux_init() | expand |
> -----Original Message----- > From: Zhengchao Shao <shaozhengchao@huawei.com> > Sent: Saturday, December 3, 2022 7:39 AM > To: netdev@vger.kernel.org; Kumar, M Chetan > <m.chetan.kumar@intel.com>; linuxwwan <linuxwwan@intel.com>; > loic.poulain@linaro.org; ryazanov.s.a@gmail.com; davem@davemloft.net; > edumazet@google.com; kuba@kernel.org; pabeni@redhat.com > Cc: johannes@sipsolutions.net; weiyongjun1@huawei.com; > yuehaibing@huawei.com; shaozhengchao@huawei.com > Subject: [PATCH] net: wwan: iosm: fix memory leak in ipc_mux_init() > > When failed to alloc ipc_mux->ul_adb.pp_qlt in ipc_mux_init(), ipc_mux is > not released. > > Fixes: 1f52d7b62285 ("net: wwan: iosm: Enable M.2 7360 WWAN card > support") > Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> Reviewed-by: M Chetan Kumar <m.chetan.kumar@intel.com>
Hello: This patch was applied to netdev/net.git (master) by Paolo Abeni <pabeni@redhat.com>: On Sat, 3 Dec 2022 10:09:03 +0800 you wrote: > When failed to alloc ipc_mux->ul_adb.pp_qlt in ipc_mux_init(), ipc_mux > is not released. > > Fixes: 1f52d7b62285 ("net: wwan: iosm: Enable M.2 7360 WWAN card support") > Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> > --- > drivers/net/wwan/iosm/iosm_ipc_mux.c | 1 + > 1 file changed, 1 insertion(+) Here is the summary with links: - net: wwan: iosm: fix memory leak in ipc_mux_init() https://git.kernel.org/netdev/net/c/23353efc26e9 You are awesome, thank you!
diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux.c b/drivers/net/wwan/iosm/iosm_ipc_mux.c index 9c7a9a2a1f25..fc928b298a98 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_mux.c +++ b/drivers/net/wwan/iosm/iosm_ipc_mux.c @@ -332,6 +332,7 @@ struct iosm_mux *ipc_mux_init(struct ipc_mux_config *mux_cfg, if (!ipc_mux->ul_adb.pp_qlt[i]) { for (j = i - 1; j >= 0; j--) kfree(ipc_mux->ul_adb.pp_qlt[j]); + kfree(ipc_mux); return NULL; } }
When failed to alloc ipc_mux->ul_adb.pp_qlt in ipc_mux_init(), ipc_mux is not released. Fixes: 1f52d7b62285 ("net: wwan: iosm: Enable M.2 7360 WWAN card support") Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> --- drivers/net/wwan/iosm/iosm_ipc_mux.c | 1 + 1 file changed, 1 insertion(+)