diff options
Diffstat (limited to 'drivers/gpu/drm/drm_crtc.c')
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 33d877c65ced..8328e7059205 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
@@ -4105,7 +4105,7 @@ drm_property_create_blob(struct drm_device *dev, size_t length, | |||
4105 | struct drm_property_blob *blob; | 4105 | struct drm_property_blob *blob; |
4106 | int ret; | 4106 | int ret; |
4107 | 4107 | ||
4108 | if (!length) | 4108 | if (!length || length > ULONG_MAX - sizeof(struct drm_property_blob)) |
4109 | return ERR_PTR(-EINVAL); | 4109 | return ERR_PTR(-EINVAL); |
4110 | 4110 | ||
4111 | blob = kzalloc(sizeof(struct drm_property_blob)+length, GFP_KERNEL); | 4111 | blob = kzalloc(sizeof(struct drm_property_blob)+length, GFP_KERNEL); |
@@ -4454,7 +4454,7 @@ int drm_mode_createblob_ioctl(struct drm_device *dev, | |||
4454 | * not associated with any file_priv. */ | 4454 | * not associated with any file_priv. */ |
4455 | mutex_lock(&dev->mode_config.blob_lock); | 4455 | mutex_lock(&dev->mode_config.blob_lock); |
4456 | out_resp->blob_id = blob->base.id; | 4456 | out_resp->blob_id = blob->base.id; |
4457 | list_add_tail(&file_priv->blobs, &blob->head_file); | 4457 | list_add_tail(&blob->head_file, &file_priv->blobs); |
4458 | mutex_unlock(&dev->mode_config.blob_lock); | 4458 | mutex_unlock(&dev->mode_config.blob_lock); |
4459 | 4459 | ||
4460 | return 0; | 4460 | return 0; |