]> Gentwo Git Trees - linux/.git/commit
drm/i915: Fix incorrect error handling in shmem_pwrite()
authorTaotao Chen <chentaotao@didiglobal.com>
Fri, 22 Aug 2025 03:07:04 +0000 (03:07 +0000)
committerAndi Shyti <andi.shyti@linux.intel.com>
Thu, 18 Sep 2025 10:57:07 +0000 (12:57 +0200)
commit6fa6c7a50e465c32a075d3e0341bcd4f0fe0bb47
tree15bc2d657a96243ea0c50afced469fe0f59bd42b
parente296a2266c572a7537e638b0dbbfc66d11df46f9
drm/i915: Fix incorrect error handling in shmem_pwrite()

shmem_pwrite() currently checks for short writes before negative error
codes, which can overwrite real errors (e.g., -EFBIG) with -EIO.
Reorder the checks to return negative errors first, then handle short
writes.

Signed-off-by: Taotao Chen <chentaotao@didiglobal.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://lore.kernel.org/r/20250822030651.28099-2-chentaotao@didiglobal.com
drivers/gpu/drm/i915/gem/i915_gem_shmem.c