All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin GAIGNARD <benjamin.gaignard@st.com>
To: dri-devel@lists.freedesktop.org
Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>, patches@linaro.org
Subject: [PATCH] drm: drm_stub: Fixing return value if driver master_set call failed
Date: Wed, 26 Jun 2013 17:58:59 +0200	[thread overview]
Message-ID: <1372262339-2469-1-git-send-email-benjamin.gaignard@linaro.org> (raw)

From: Benjamin Gaignard <benjamin.gaignard@linaro.org>

When dev->driver->master_set() failed ioctl call return 0
but the caller is not the DRM-Master because file_priv->is_master = 0.
Fix that by returning to ioctl caller the driver master_set error code.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
---
 drivers/gpu/drm/drm_stub.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
index 16f3ec5..a2f8c92 100644
--- a/drivers/gpu/drm/drm_stub.c
+++ b/drivers/gpu/drm/drm_stub.c
@@ -203,7 +203,7 @@ EXPORT_SYMBOL(drm_master_put);
 int drm_setmaster_ioctl(struct drm_device *dev, void *data,
 			struct drm_file *file_priv)
 {
-	int ret;
+	int ret = 0;
 
 	if (file_priv->is_master)
 		return 0;
@@ -229,7 +229,7 @@ int drm_setmaster_ioctl(struct drm_device *dev, void *data,
 	}
 	mutex_unlock(&dev->struct_mutex);
 
-	return 0;
+	return ret;
 }
 
 int drm_dropmaster_ioctl(struct drm_device *dev, void *data,
-- 
1.7.9.5

                 reply	other threads:[~2013-06-26 16:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1372262339-2469-1-git-send-email-benjamin.gaignard@linaro.org \
    --to=benjamin.gaignard@st.com \
    --cc=benjamin.gaignard@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=patches@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.