From: Lucas De Marchi Date: Mon, 22 Sep 2025 22:11:34 +0000 (-0700) Subject: drm/xe/psmi: Do not return NULL X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2598d9b4208cafa46f6649e679cdba67fcf0436a;p=thirdparty%2Fkernel%2Flinux.git 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 Closes: https://lore.kernel.org/r/aK1nZjyAF0s7bnHg@stanley.mountain Reviewed-by: Rodrigo Vivi Link: https://lore.kernel.org/r/20250922221133.109921-2-lucas.demarchi@intel.com Signed-off-by: Lucas De Marchi --- diff --git a/drivers/gpu/drm/xe/xe_psmi.c b/drivers/gpu/drm/xe/xe_psmi.c index 45d142191d600..6a54e38b81ba9 100644 --- a/drivers/gpu/drm/xe/xe_psmi.c +++ b/drivers/gpu/drm/xe/xe_psmi.c @@ -70,8 +70,8 @@ static struct xe_bo *psmi_alloc_object(struct xe_device *xe, { struct xe_tile *tile; - if (!id || !bo_size) - return NULL; + xe_assert(xe, id); + xe_assert(xe, bo_size); tile = &xe->tiles[id - 1];