Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe/psmi: Do not return NULL

The checks for id and bo_size are impossible conditions. If they were
possible, then the caller should not be using IS_ERR(). Just replace
them with asserts which should be compiled out when not debugging and
at the same time prevent other refactors to break this assumption.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/aK1nZjyAF0s7bnHg@stanley.mountain
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/20250922221133.109921-2-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

+2 -2
+2 -2
drivers/gpu/drm/xe/xe_psmi.c
··· 70 70 { 71 71 struct xe_tile *tile; 72 72 73 - if (!id || !bo_size) 74 - return NULL; 73 + xe_assert(xe, id); 74 + xe_assert(xe, bo_size); 75 75 76 76 tile = &xe->tiles[id - 1]; 77 77