Skip to content

Commit ec2f87a

Browse files
Dikshita Agarwalgregkh
authored andcommitted
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: 73702f4 ("media: iris: allocate, initialize and queue internal buffers") Cc: [email protected] Reviewed-by: Vikash Garodia <[email protected]> Tested-by: Vikash Garodia <[email protected]> # X1E80100 Tested-by: Neil Armstrong <[email protected]> # on SM8550-HDK Tested-by: Neil Armstrong <[email protected]> # on SM8650-HDK Signed-off-by: Dikshita Agarwal <[email protected]> Tested-by: Bryan O'Donoghue <[email protected]> # x1e80100-crd Signed-off-by: Bryan O'Donoghue <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 500fcc3 commit ec2f87a

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

drivers/media/platform/qcom/iris/iris_buffer.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,16 @@ static int iris_destroy_internal_buffers(struct iris_inst *inst, u32 plane, bool
413413
}
414414
}
415415

416+
if (force) {
417+
buffers = &inst->buffers[BUF_PERSIST];
418+
419+
list_for_each_entry_safe(buf, next, &buffers->list, list) {
420+
ret = iris_destroy_internal_buffer(inst, buf);
421+
if (ret)
422+
return ret;
423+
}
424+
}
425+
416426
return 0;
417427
}
418428

0 commit comments

Comments
 (0)