]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: iris: gen1: Destroy internal buffers after FW releases
authorDikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Mon, 29 Dec 2025 06:31:22 +0000 (12:01 +0530)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Tue, 20 Jan 2026 13:00:12 +0000 (14:00 +0100)
After the firmware releases internal buffers, the driver was not
destroying them. This left stale allocations that were no longer used,
especially across resolution changes where new buffers are allocated per
the updated requirements. As a result, memory was wasted until session
close.

Destroy internal buffers once the release response is received from the
firmware.

Fixes: 73702f45db81 ("media: iris: allocate, initialize and queue internal buffers")
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c

index 1c107daca9e89e06f284959b79518fa0edb230c7..11815f6f5bacd4b464f6c76fd32adbd59d4167a7 100644 (file)
@@ -441,6 +441,8 @@ static int iris_hfi_gen1_session_unset_buffers(struct iris_inst *inst, struct ir
                goto exit;
 
        ret = iris_wait_for_session_response(inst, false);
+       if (!ret)
+               ret = iris_destroy_internal_buffer(inst, buf);
 
 exit:
        kfree(pkt);