diff options
| author | Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com> | 2025-12-29 12:01:20 +0530 |
|---|---|---|
| committer | Hans Verkuil <hverkuil+cisco@kernel.org> | 2026-01-20 14:00:12 +0100 |
| commit | 2d0bbd982dfdd67da488a772f7a8a1bdca7642bf (patch) | |
| tree | 906ef01c2136ef7d3f6edc346f3f417625b68a00 /drivers/android/binder_alloc.h | |
| parent | bbef55f414100853d5bcea56a41f8b171bac8fcb (diff) | |
| download | linux-2d0bbd982dfdd67da488a772f7a8a1bdca7642bf.tar.gz linux-2d0bbd982dfdd67da488a772f7a8a1bdca7642bf.zip | |
media: iris: Add buffer to list only after successful allocation
Move `list_add_tail()` to after `dma_alloc_attrs()` succeeds when creating
internal buffers. Previously, the buffer was enqueued in `buffers->list`
before the DMA allocation. If the allocation failed, the function returned
`-ENOMEM` while leaving a partially initialized buffer in the list, which
could lead to inconsistent state and potential leaks.
By adding the buffer to the list only after `dma_alloc_attrs()` succeeds,
we ensure the list contains only valid, fully initialized buffers.
Fixes: 73702f45db81 ("media: iris: allocate, initialize and queue internal buffers")
Reviewed-by: Bryan O'Donoghue <bod@kernel.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>
Diffstat (limited to 'drivers/android/binder_alloc.h')
0 files changed, 0 insertions, 0 deletions
