Message ID | 20241115002748.7200-1-zichenxie0106@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | drm: Use array_size() in call to copy_from_user() in drm_mode_dirtyfb_ioctl() | expand |
diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 888aadb6a4ac..323fb194ca17 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -752,7 +752,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev, } ret = copy_from_user(clips, clips_ptr, - num_clips * sizeof(*clips)); + array_size(num_clips, sizeof(*clips))); if (ret) { ret = -EFAULT; goto out_err2;