Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5bb37dc authored by Kalyan Thota's avatar Kalyan Thota Committed by Gerrit - the friendly Code Review server
Browse files

drm: lock the user blob access while traversing the list



Lock the file_priv->blobs when they are traversed for count.

Change-Id: If49eeac38c6b0455286279e5f96c8855f5e9f063
Signed-off-by: default avatarKalyan Thota <kalyant@codeaurora.org>
parent 6d0b2be2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -768,9 +768,13 @@ int drm_mode_createblob_ioctl(struct drm_device *dev,
	if (!drm_core_check_feature(dev, DRIVER_MODESET))
		return -EINVAL;

	mutex_lock(&dev->mode_config.blob_lock);

	list_for_each_entry(bt, &file_priv->blobs, head_file)
		count++;

	mutex_unlock(&dev->mode_config.blob_lock);

	if (count == MAX_BLOB_PROP_COUNT)
		return -EINVAL;