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

Commit 537946c5 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "disp: msm: sde: add null check for drm file in msm_release"

parents f3befbd1 768ec57e
Loading
Loading
Loading
Loading
+22 −4
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@
#define MSM_VERSION_MINOR	2
#define MSM_VERSION_PATCHLEVEL	0

static DEFINE_MUTEX(msm_release_lock);

static void msm_fb_output_poll_changed(struct drm_device *dev)
{
	struct msm_drm_private *priv = NULL;
@@ -1420,13 +1422,25 @@ void msm_mode_object_event_notify(struct drm_mode_object *obj,
static int msm_release(struct inode *inode, struct file *filp)
{
	struct drm_file *file_priv = filp->private_data;
	struct drm_minor *minor = file_priv->minor;
	struct drm_device *dev = minor->dev;
	struct msm_drm_private *priv = dev->dev_private;
	struct drm_minor *minor;
	struct drm_device *dev;
	struct msm_drm_private *priv;
	struct msm_drm_event *node, *temp, *tmp_node;
	u32 count;
	unsigned long flags;
	LIST_HEAD(tmp_head);
	int ret = 0;

	mutex_lock(&msm_release_lock);

	if (!file_priv) {
		ret = -EINVAL;
		goto end;
	}

	minor = file_priv->minor;
	dev = minor->dev;
	priv = dev->dev_private;

	spin_lock_irqsave(&dev->event_lock, flags);
	list_for_each_entry_safe(node, temp, &priv->client_event_list,
@@ -1454,7 +1468,11 @@ static int msm_release(struct inode *inode, struct file *filp)
		kfree(node);
	}

	return drm_release(inode, filp);
	ret = drm_release(inode, filp);
	filp->private_data = NULL;
end:
	mutex_unlock(&msm_release_lock);
	return ret;
}

/**