drm/imagination: Correctly check strscpy() in pvr_gpuid_decode_string()
Subsystems (3)
PATCH 1/1 drm/imagination: Correctly check strscpy() in pvr_gpuid_decode_string()
The constant PVR_GPUID_STRING_MIN_LENGTH was defined with a U suffix, causing the return value of strscpy() to be promoted to unsigned before it could be checked for a negative errno.
Fix this by stripping the U suffix from PVR_GPUID_STRING_MIN_LENGTH (and PVR_GPUID_STRING_MAX_LENGTH for consistency).
Fixes 3bf74137340a ("drm/imagination: Add gpuid module parameter")
Reported-by Dan Carpenter <[email protected]>
Signed-off-by Matt Coster <[email protected]>
--- drivers/gpu/drm/imagination/pvr_device.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/imagination/pvr_device.h +2 -2
@@ -39,8 +39,8 @@ struct firmware;/* Forward declaration from <linux/pwrseq/consumer.h> */ struct pwrseq_desc ; -#define PVR_GPUID_STRING_MIN_LENGTH 7U -#define PVR_GPUID_STRING_MAX_LENGTH 32U +#define PVR_GPUID_STRING_MIN_LENGTH 7 +#define PVR_GPUID_STRING_MAX_LENGTH 32/** * struct pvr_gpu_id - Hardware GPU ID information for a PowerVR device
---
base-commit: 69674c1c704c0199ca7a3947f3cdcd575973175d
change-id: 20260206-gpuid-strlen-fix-5622c1fdd0b2