summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDikshita Agarwal <quic_dikshita@quicinc.com>2025-08-25 12:30:27 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-06 11:20:06 +0200
commitec2f87ad035e8d1ad67567542842f1f23a4dbde2 (patch)
tree2af79e82ad4cb6e9e3cac090d6091c04caacb79a
parent500fcc31e488d798937a23dbb1f62db46820c5b2 (diff)
downloadlinux-ec2f87ad035e8d1ad67567542842f1f23a4dbde2.tar.gz
linux-ec2f87ad035e8d1ad67567542842f1f23a4dbde2.tar.bz2
linux-ec2f87ad035e8d1ad67567542842f1f23a4dbde2.zip
media: iris: Fix memory leak by freeing untracked persist buffer
commit 02a24f13b3a1d9da9f3de56aa5fdb7cc1fe167a2 upstream. One internal buffer which is allocated only once per session was not being freed during session close because it was not being tracked as part of internal buffer list which resulted in a memory leak. Add the necessary logic to explicitly free the untracked internal buffer during session close to ensure all allocated memory is released properly. Fixes: 73702f45db81 ("media: iris: allocate, initialize and queue internal buffers") Cc: stable@vger.kernel.org Reviewed-by: Vikash Garodia <quic_vgarodia@quicinc.com> Tested-by: Vikash Garodia <quic_vgarodia@quicinc.com> # X1E80100 Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550-HDK Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-HDK Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com> Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> # x1e80100-crd Signed-off-by: Bryan O'Donoghue <bod@kernel.org> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/media/platform/qcom/iris/iris_buffer.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/media/platform/qcom/iris/iris_buffer.c b/drivers/media/platform/qcom/iris/iris_buffer.c
index 6425e4919e3b..9f664c241149 100644
--- a/drivers/media/platform/qcom/iris/iris_buffer.c
+++ b/drivers/media/platform/qcom/iris/iris_buffer.c
@@ -413,6 +413,16 @@ static int iris_destroy_internal_buffers(struct iris_inst *inst, u32 plane, bool
}
}
+ if (force) {
+ buffers = &inst->buffers[BUF_PERSIST];
+
+ list_for_each_entry_safe(buf, next, &buffers->list, list) {
+ ret = iris_destroy_internal_buffer(inst, buf);
+ if (ret)
+ return ret;
+ }
+ }
+
return 0;
}