freebsd-dev/sys/compat
Austin Shafer 4085bde9fa linuxkpi: Fix return value of dma_map_sgtable
dma_map_sgtable internally uses the dma_map_sg_attrs helper. The problem is
that dma_map_sg_attrs returns the number of entries mapped, whereas
dma_map_sgtable returns nonzero on failure. This leads to dma_map_sgtable
returning non-zero-but-positive values which tricks other areas of the stack
into thinking nents is a valid pointer.

This checks if nents is valid and returns zero if so, updating the nents field
in sgt. This fixes PRIME render offload with nvidia-drm.

Fixes:	9202c95f47 ("linuxkpi: Add dma_{un,}map_sgtable")
2022-12-06 16:25:53 +01:00
..
freebsd32 compat32: retire now-unused MIPS support 2022-11-23 09:33:43 -05:00
ia32 Retire sv_transtrap 2022-05-20 14:54:03 +03:00
lindebugfs LinuxKPI,lindebugfs: add u8 base type and blob support 2022-11-28 17:21:50 +00:00
linprocfs linprocfs: Add net/route. 2022-10-22 13:52:58 +03:00
linsysfs linsysfs: plug set-but-not-used vars. 2022-03-31 23:49:26 +03:00
linux linux(4): Fix get_robust_list() syscall return value. 2022-11-09 00:17:17 +03:00
linuxkpi linuxkpi: Fix return value of dma_map_sgtable 2022-12-06 16:25:53 +01:00
x86bios pmap_unmapdev/bios: Accept a pointer instead of a vm_offset_t. 2022-09-22 15:08:52 -07:00