Commit 7a100e6d authored by Ashutosh Dixit's avatar Ashutosh Dixit
Browse files

drm/xe/oa: Disallow 0 OA property values



An OA property value of 0 is invalid and will cause a NPD.

Reported-by: default avatarPeter Senna Tschudin <peter.senna@linux.intel.com>
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/6452


Fixes: cc4e6994 ("drm/xe/oa: Move functions up so they can be reused for config ioctl")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarAshutosh Dixit <ashutosh.dixit@intel.com>
Reviewed-by: default avatarHarish Chegondi <harish.chegondi@intel.com>
Link: https://patch.msgid.link/20251212061850.1565459-3-ashutosh.dixit@intel.com
parent 97e16068
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1347,7 +1347,7 @@ static int xe_oa_user_ext_set_property(struct xe_oa *oa, enum xe_oa_user_extn_fr
		     ARRAY_SIZE(xe_oa_set_property_funcs_config));

	if (XE_IOCTL_DBG(oa->xe, ext.property >= ARRAY_SIZE(xe_oa_set_property_funcs_open)) ||
	    XE_IOCTL_DBG(oa->xe, ext.pad))
	    XE_IOCTL_DBG(oa->xe, !ext.property) || XE_IOCTL_DBG(oa->xe, ext.pad))
		return -EINVAL;

	idx = array_index_nospec(ext.property, ARRAY_SIZE(xe_oa_set_property_funcs_open));