|
@@ -102,7 +102,7 @@ int i915_query_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
|
|
|
|
|
|
for (i = 0; i < args->num_items; i++, user_item_ptr++) {
|
|
|
struct drm_i915_query_item item;
|
|
|
- u64 func_idx;
|
|
|
+ unsigned long func_idx;
|
|
|
int ret;
|
|
|
|
|
|
if (copy_from_user(&item, user_item_ptr, sizeof(item)))
|
|
@@ -111,6 +111,9 @@ int i915_query_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
|
|
|
if (item.query_id == 0)
|
|
|
return -EINVAL;
|
|
|
|
|
|
+ if (overflows_type(item.query_id - 1, unsigned long))
|
|
|
+ return -EINVAL;
|
|
|
+
|
|
|
func_idx = item.query_id - 1;
|
|
|
|
|
|
ret = -EINVAL;
|