Re: [PATCH v2] drm/v3d: Fix double free of the sg_table when a PRIME import fails
From: Roy
Date: Sun Nov 29 2026 - 03:05:36 EST
Hi Aleksei,
I hit the same bug from raspberrypi/linux#7504 and sent a duplicate
fix before I saw yours, sorry for the noise.
I tested v2 on a Raspberry Pi 5 with 6.18.39, as an out-of-tree v3d
module. My reproducer fills the V3D address space and then imports a
vc4 dumb buffer. Without the patch it oopses in dma_direct_unmap_sg().
With the patch the import fails with -ENOSPC (20 runs), and bo_stats
and dma_buf/bufinfo are empty afterwards. Self-import of a v3d BO gives
the same offset (1000 runs), a vc4 buffer imported into v3d can be
mmapped and read back, and the igt v3d tests pass (82 pass, 2 skip, as
without the patch).
Tested-by: Roy <rongh7426@xxxxxxxxx>
Thanks,
Roy