From patchwork Wed Jun 26 15:58:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 2791701 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A60579F756 for ; Thu, 27 Jun 2013 10:54:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 85C2A20320 for ; Thu, 27 Jun 2013 10:54:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3886D2031C for ; Thu, 27 Jun 2013 10:54:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3E0F1E628A for ; Thu, 27 Jun 2013 03:54:30 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 1781 seconds by postgrey-1.32 at gabe; Wed, 26 Jun 2013 09:28:58 PDT Received: from eu1sys200aog125.obsmtp.com (eu1sys200aog125.obsmtp.com [207.126.144.159]) by gabe.freedesktop.org (Postfix) with ESMTP id E115FE63CC for ; Wed, 26 Jun 2013 09:28:58 -0700 (PDT) Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob125.postini.com ([207.126.147.11]) with SMTP ID DSNKUcsWyf8R6XHYH63EYiW6POreBYBbu7XA@postini.com; Wed, 26 Jun 2013 16:28:59 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 2115AB2; Wed, 26 Jun 2013 15:59:15 +0000 (GMT) Received: from mail7.sgp.st.com (unknown [164.129.223.81]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E289557D8; Wed, 26 Jun 2013 15:58:50 +0000 (GMT) Received: from amgrou.rou.st.com (amgrou.rou.st.com [164.129.206.176]) by mail7.sgp.st.com (MOS 4.3.3-GA) with ESMTP id BGO63816; Wed, 26 Jun 2013 17:59:14 +0200 Received: from lme3sd00.lme.st.com (lme3sd00.lme.st.com [10.201.18.26]) by amgrou.rou.st.com (STMicroelectronics) with ESMTP id DFE5D127A46; Wed, 26 Jun 2013 15:45:33 +0000 (GMT) Received: from st.com (lmenx321.lme.st.com [10.201.23.15]) by lme3sd00.lme.st.com (8.13.8+Sun/8.13.8) with ESMTP id r5QFxDRX002788; Wed, 26 Jun 2013 17:59:13 +0200 (MEST) Received: (from frq08944@localhost) by st.com (8.14.4/8.13.6/Submit) id r5QFxDb0002522; Wed, 26 Jun 2013 17:59:13 +0200 From: Benjamin GAIGNARD To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm: drm_stub: Fixing return value if driver master_set call failed Date: Wed, 26 Jun 2013 17:58:59 +0200 Message-Id: <1372262339-2469-1-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Mailman-Approved-At: Thu, 27 Jun 2013 03:51:42 -0700 Cc: Benjamin Gaignard , patches@linaro.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Benjamin Gaignard 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 --- 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,