]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/display: Fix an unsigned subtraction which can never be negative.
authorHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Fri, 10 Dec 2021 04:41:24 +0000 (20:41 -0800)
committerLucas De Marchi <lucas.demarchi@intel.com>
Mon, 13 Dec 2021 04:55:37 +0000 (20:55 -0800)
commitdbab0ba8003f1900090a84270d4bc1dd8078a1e3
tree9df4f2d77894d9999dba8ecd4de74ff3eb52f94d
parent5e6ff033b982efaa3df3aa7b510a69f70cc259cd
drm/i915/display: Fix an unsigned subtraction which can never be negative.

smatch warning:
drivers/gpu/drm/i915/display/intel_dmc.c:601 parse_dmc_fw() warn:
unsigned 'fw->size - offset' is never less than zero

Firmware size is size_t and offset is u32. So the subtraction is
unsigned which can never be less than zero.

Fixes: d285ad9f3649 ("drm/i915/xelpd: Pipe A DMC plugging")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211210044129.12422-1-harshit.m.mogalapalli@oracle.com
drivers/gpu/drm/i915/display/intel_dmc.c