]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:49:26 +0000 (09:49 +0100)
commit0c4e68689d4e9fefecdae709675895a69c39a1f0
treef644d0cc8384b02c89bd7a45a7c91d3949419e75
parent79da4c7a11170bd000c875976ac641b32ca6ad3c
drm/i915/display: Fix an unsigned subtraction which can never be negative.

BugLink: https://bugs.launchpad.net/bugs/1956302
[ Upstream commit 53b3495273282aa844c4613d19c3b30558c70c84 ]

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: 3d5928a168a9 ("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
(cherry picked from commit 87bb2a410dcfb617b88e4695edf4beb6336dc314)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
drivers/gpu/drm/i915/display/intel_dmc.c