msm: ipa: Avoid use-after-free scenario

Introduce changes to avoid use-after-free
scenarios by accessing the memory before
freeing it.

Change-Id: Iaa5d29b400cad593045f3644cb60a51fc09682e8
Signed-off-by: Prasad Arepalli <quic_parepall@quicinc.com>
This commit is contained in:
Prasad Arepalli 2025-07-07 15:14:17 +05:30
commit 610bee83fa

View file

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
*/
#include <linux/debugfs.h>
@ -770,9 +771,9 @@ int ipa_pm_register(struct ipa_pm_register_params *params, u32 *hdl)
client->skip_clk_vote = params->skip_clk_vote;
client->wlock = wakeup_source_register(NULL, client->name);
if (!client->wlock) {
ipa_pm_deregister(*hdl);
IPA_PM_ERR("IPA wakeup source register failed %s\n",
client->name);
ipa_pm_deregister(*hdl);
return -ENOMEM;
}