From patchwork Fri Sep 16 18:22:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 9336369 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 957F86077F for ; Fri, 16 Sep 2016 18:22:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B9942A05E for ; Fri, 16 Sep 2016 18:22:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 801842A062; Fri, 16 Sep 2016 18:22:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1BC9C2A05E for ; Fri, 16 Sep 2016 18:22:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A5BA36E289; Fri, 16 Sep 2016 18:22:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x22a.google.com (mail-qk0-x22a.google.com [IPv6:2607:f8b0:400d:c09::22a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0BAA46E02F for ; Fri, 16 Sep 2016 18:22:11 +0000 (UTC) Received: by mail-qk0-x22a.google.com with SMTP id z190so96212193qkc.3 for ; Fri, 16 Sep 2016 11:22:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=BZEjiH9KggcLDtCammanIKnZRokLsdr+fyZIoiQ7ttU=; b=j2qfcnoT72ck6/BBmvK+oL8noHuIRauymvycb/0a87qo8UEfO7E4JM6/Hbu6/wiGss A2L5+bURuP2Y+ImzVR6mYOCGqa62VTOgoLau3SCYY46trQkmDRT21wyEdi6+0slVQase 2az74E+73Wi6vnVfNk8fNI5T/PCtE2apptKXw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=BZEjiH9KggcLDtCammanIKnZRokLsdr+fyZIoiQ7ttU=; b=c0In43a0IK0SXXPYmCk8Kam2tYgZi0124v4SzWYJiT9eqUIqEyvBkJtd5B2m/sopro bLKj1+M067fb1qzJ+86yliLk0eqwm0AvlBt8xkhM9XOxtM0s3wHxoj+qWSowIxE8KgJy bYaEDE3Jcr3w8dN9QYZuOVCw+uNJ8/3IovXsk0vmQyhrQ1TePha5jEFuX+1q4HGaetes UVmYdPP5+k59dEXuq8Z5FIEWiDFrEzq/+QRFs1na1vce9Ii33C+yy4rUDkp2o6qIMuVG YTJB60SBib4rmJkoc/JYril7SQraQTKVRYD6STJEqbUp3ZSMrSvB6Dtv9FXByZlJGWbt tI2w== X-Gm-Message-State: AE9vXwMq5MZfXAzKzhhFWwurC1hsVmh4rzdXGuJxt5Z3NXwemDx5e8mK6na9bk0LqUrquIM7 X-Received: by 10.55.144.71 with SMTP id s68mr17386914qkd.62.1474050129579; Fri, 16 Sep 2016 11:22:09 -0700 (PDT) Received: from boxwood.roam.corp.google.com (cpe-75-189-128-87.nc.res.rr.com. [75.189.128.87]) by smtp.gmail.com with ESMTPSA id h12sm5393237qth.11.2016.09.16.11.22.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Sep 2016 11:22:08 -0700 (PDT) From: Sean Paul To: mark.yao@rock-chips.com, heiko@sntech.de, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/rockchip: Balance irq refcount on failure Date: Fri, 16 Sep 2016 14:22:03 -0400 Message-Id: <1474050123-29897-1-git-send-email-seanpaul@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 Cc: linux-rockchip@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP If create_crtc fails in vop bind, ensure the irq refcount is zeroed back out before exiting. Signed-off-by: Sean Paul Reviewed-by: Daniel Kurtz --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 57650c9..131ae0f 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -1551,11 +1551,15 @@ static int vop_bind(struct device *dev, struct device *master, void *data) ret = vop_create_crtc(vop); if (ret) - return ret; + goto err_enable_irq; pm_runtime_enable(&pdev->dev); return 0; + +err_enable_irq: + enable_irq(vop->irq); /* To balance out the disable_irq above */ + return ret; } static void vop_unbind(struct device *dev, struct device *master, void *data)