]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/imagination: Fix returned size for DRM_IOCTL_PVR_DEV_QUERY
authorBrajesh Gupta <brajesh.gupta@imgtec.com>
Wed, 1 Jul 2026 05:19:30 +0000 (10:49 +0530)
committerAlessio Belle <alessio.belle@imgtec.com>
Thu, 2 Jul 2026 10:15:59 +0000 (11:15 +0100)
commitd431b4012fd22920523dbd2806da663c1048e386
treee9dffe2d1781199c79a3f27109e1065c702e8838
parent4af24c27a39ba147a613a09e10b9e0f7294524c0
drm/imagination: Fix returned size for DRM_IOCTL_PVR_DEV_QUERY

For a few subtypes of DRM_IOCTL_PVR_DEV_QUERY, driver was overriding
the returned size unconditionally. This would have resulted in
increase of reported size beyond the amount of data returned to
userspace when args->size < size of query structure.

Updated behaviour matches with the description of
drm_pvr_ioctl_dev_query_args.size and written byte length.
None of the structures of DRM_IOCTL_PVR_DEV_QUERY changed after addition,
so change will not break any compatibility with earlier version.

Fixes: f99f5f3ea7ef ("drm/imagination: Add GPU ID parsing and firmware loading")
Fixes: ff5f643de0bf ("drm/imagination: Add GEM and VM related code")
Signed-off-by: Brajesh Gupta <brajesh.gupta@imgtec.com>
Reviewed-by: Alessio Belle <alessio.belle@imgtec.com>
Link: https://patch.msgid.link/20260701-b4-b4-query-v2-1-a1b491387875@imgtec.com
Signed-off-by: Alessio Belle <alessio.belle@imgtec.com>
drivers/gpu/drm/imagination/pvr_drv.c
drivers/gpu/drm/imagination/pvr_vm.c