Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee8cff46 authored by Xiu Jianfeng's avatar Xiu Jianfeng Committed by Greg Kroah-Hartman
Browse files

wifi: iwlwifi: Fix memory leak in iwl_mvm_init()



[ Upstream commit ed2e916c890944633d6826dce267579334f63ea5 ]

When iwl_opmode_register() fails, it does not unregster rate control,
which will cause a memory leak issue, this patch fixes it.

Fixes: 9f66a397 ("iwlwifi: mvm: rs: add ops for the new rate scaling in the FW")
Signed-off-by: default avatarXiu Jianfeng <xiujianfeng@huawei.com>
Link: https://patch.msgid.link/20221109035213.570-1-xiujianfeng@huawei.com


Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent e64732eb
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -123,8 +123,10 @@ static int __init iwl_mvm_init(void)
	}

	ret = iwl_opmode_register("iwlmvm", &iwl_mvm_ops);
	if (ret)
	if (ret) {
		pr_err("Unable to register MVM op_mode: %d\n", ret);
		iwl_mvm_rate_control_unregister();
	}

	return ret;
}