summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXu Rao <raoxu@uniontech.com>2026-06-23 10:13:08 +0300
committerTakashi Iwai <tiwai@suse.de>2026-06-25 14:56:21 +0300
commitb8ff1f3578f83dedf5feb796d97a3f67c1bea58f (patch)
treeb10dc6476f90d9e6386335e58c53f45ad0b94e33
parent6485da8579e2b0132630faa1ee2ac72ccaf01501 (diff)
downloadlinux-b8ff1f3578f83dedf5feb796d97a3f67c1bea58f.tar.xz
ALSA: usb-audio: qcom: Free QMI handle
qc_usb_audio_probe() allocates svc->uaudio_svc_hdl separately from the uaudio_qmi_svc object. qmi_handle_release() releases the resources owned by an initialized QMI handle, but does not free the memory containing the struct qmi_handle itself. The probe error path and the remove path currently release the handle and then free svc, losing the last pointer to the separately allocated handle. This leaks one struct qmi_handle on each affected probe unwind and on each successful probe/remove cycle. Free the handle after qmi_handle_release() in both paths. Signed-off-by: Xu Rao <raoxu@uniontech.com> Link: https://patch.msgid.link/9108EC860F3F87DF+20260623071308.2549182-1-raoxu@uniontech.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/usb/qcom/qc_audio_offload.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/usb/qcom/qc_audio_offload.c b/sound/usb/qcom/qc_audio_offload.c
index 3a586fd16e72..e4bfd43a2488 100644
--- a/sound/usb/qcom/qc_audio_offload.c
+++ b/sound/usb/qcom/qc_audio_offload.c
@@ -1988,6 +1988,7 @@ static int qc_usb_audio_probe(struct auxiliary_device *auxdev,
release_qmi:
qc_usb_audio_cleanup_qmi_dev();
qmi_handle_release(svc->uaudio_svc_hdl);
+ kfree(svc->uaudio_svc_hdl);
free_svc:
kfree(svc);
@@ -2012,6 +2013,7 @@ static void qc_usb_audio_remove(struct auxiliary_device *auxdev)
qc_usb_audio_cleanup_qmi_dev();
qmi_handle_release(svc->uaudio_svc_hdl);
+ kfree(svc->uaudio_svc_hdl);
kfree(svc);
uaudio_svc = NULL;
}