diff mbox series

net: wwan: iosm: fix memory leak in ipc_mux_init()

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

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 10 of 10 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

shaozhengchao Dec. 3, 2022, 2:09 a.m. UTC
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(+)

Comments

Kumar, M Chetan Dec. 3, 2022, 7 a.m. UTC | #1
> -----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>
patchwork-bot+netdevbpf@kernel.org Dec. 6, 2022, 10:50 a.m. UTC | #2
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 mbox series

Patch

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;
 			}
 		}