Hi Krzysztof On Mon Sep 8, 2025 at 9:25 AM UTC, Krzysztof Karas wrote: > There are two unsafe scenarios in that function: > 1) drm_format_info_block_width/height() may return 0 and cause > division by 0 down the line. Return early if any of these values > are 0. > 2) dma_addr calculations are carried out using 32-bit > arithmetic, which could cause a truncation of the values > before they are extended to 64 bits. Cast one of the operands > to dma_addr_t, so 64-bit arithmetic is used. > > Fixes: 8c30eecc6769 ("drm/gem: rename struct drm_gem_dma_object.{paddr => > dma_addr}") > Cc: Danilo Krummrich <d...@redhat.com> > Cc: <sta...@vger.kernel.org> # v6.1+ > Signed-off-by: Krzysztof Karas <krzysztof.ka...@intel.com> > --- LGTM it could probably be split into two patches, but the changes are pretty small and it doesn’t really bother me. drm_format_info_block_h/w can both potentially return 0, so it's good to verify their return values.
Reviewed-by: Sebastian Brzezinka <sebastian.brzezi...@intel.com> -- Best regards, Sebastian