From patchwork Thu Oct 9 09:16:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Courbot X-Patchwork-Id: 5057151 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 670139F295 for ; Thu, 9 Oct 2014 09:16:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 989FA2015D for ; Thu, 9 Oct 2014 09:16:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id AADEC20125 for ; Thu, 9 Oct 2014 09:16:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EEC126E314; Thu, 9 Oct 2014 02:16:55 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from hqemgate14.nvidia.com (hqemgate14.nvidia.com [216.228.121.143]) by gabe.freedesktop.org (Postfix) with ESMTP id BC7FA6E314 for ; Thu, 9 Oct 2014 02:16:54 -0700 (PDT) Received: from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com id ; Thu, 09 Oct 2014 02:17:45 -0700 Received: from hqemhub01.nvidia.com ([172.20.12.94]) by hqnvupgp08.nvidia.com (PGP Universal service); Thu, 09 Oct 2014 02:16:40 -0700 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Thu, 09 Oct 2014 02:16:40 -0700 Received: from percival.nvidia.com (172.20.144.16) by hqemhub01.nvidia.com (172.20.150.30) with Microsoft SMTP Server (TLS) id 8.3.342.0; Thu, 9 Oct 2014 02:16:53 -0700 From: Alexandre Courbot To: Thierry Reding Subject: [PATCH] drm: tegra: Check return value of drm_vblank_get() Date: Thu, 9 Oct 2014 18:16:49 +0900 Message-ID: <1412846209-28630-1-git-send-email-acourbot@nvidia.com> X-Mailer: git-send-email 2.1.2 X-NVConfidentiality: public MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 drm_vblank_get() can return an error, which we should propagate. Signed-off-by: Alexandre Courbot --- drivers/gpu/drm/tegra/dc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 6553fd238685..b08df07cad47 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -699,6 +699,7 @@ static int tegra_dc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, { struct tegra_dc *dc = to_tegra_dc(crtc); struct drm_device *drm = crtc->dev; + int ret; if (dc->event) return -EBUSY; @@ -706,7 +707,9 @@ static int tegra_dc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, if (event) { event->pipe = dc->pipe; dc->event = event; - drm_vblank_get(drm, dc->pipe); + ret = drm_vblank_get(drm, dc->pipe); + if (ret < 0) + return ret; } tegra_dc_set_base(dc, 0, 0, fb);