From patchwork Mon Mar 7 22:00:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 8523331 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 936D0C0553 for ; Mon, 7 Mar 2016 22:01:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B631C200F4 for ; Mon, 7 Mar 2016 22:01:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DFD2B20103 for ; Mon, 7 Mar 2016 22:01:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ad3Dj-0007ro-E4; Mon, 07 Mar 2016 22:01:43 +0000 Received: from mail-pa0-x236.google.com ([2607:f8b0:400e:c03::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ad3Dh-0007hI-30 for linux-rockchip@lists.infradead.org; Mon, 07 Mar 2016 22:01:41 +0000 Received: by mail-pa0-x236.google.com with SMTP id fl4so85403429pad.0 for ; Mon, 07 Mar 2016 14:01:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=yf8pIDPa6phfPcpnWGc9FOqTaMqY2KKKJOAcQ9T3qI8=; b=lag+2ucEE8rcCpffbLbT9/EbhrCGrl54najZVNsIO39vOjye6hKf9xryxOOf/4ALqv P/mQ9daGk9h5ZWh7ex8B0F2nHMODFMIrb6dLE3sp6HrP34FABuMiP7SYbanNQQYYX/yV iLNa+ltQgR2u/jTaSC1RTBzYryd4Tsi1Et9Ks= 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=yf8pIDPa6phfPcpnWGc9FOqTaMqY2KKKJOAcQ9T3qI8=; b=C0RTVsCZFvmv3TEMXqP1ZPStLKYJrjgUA+tYFTCq3p3iAaEXGfCcdg/adLc1vgWsUr aIFqzEgsAmEA0A4JcSrjKc351w6b+2cyu/bz9gEmfAWXEDV4SWD/Qet1dHrImIYxC1lW xrZcRuIHBGiCLZoDUSYzRIuzOYybE00wDnZBAr2xPpusJmAKqbkkG9Gyht8Rl9tjJFBj eUaxc/R6Gzm9i3ifHjTjWnkSmPbbT87R9WUxWyWtvYLjOW7MUlzIclu/91Q7giKPYHst nVEW6Kol9qY9moVeEVttaPP3MKR8wLXO+nBkgVoIElfsnAjTshitcaEtAkADTUyLOcRN JIjg== X-Gm-Message-State: AD7BkJKSzG+jiaxs5vFTndIjWS8FS90TmJCtkiuKxwJVfWt/EReec9gRoUOKtsf7bIZB8A== X-Received: by 10.66.139.199 with SMTP id ra7mr36854421pab.74.1457388080043; Mon, 07 Mar 2016 14:01:20 -0800 (PST) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by smtp.gmail.com with ESMTPSA id p26sm19964195pfi.84.2016.03.07.14.01.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Mar 2016 14:01:18 -0800 (PST) From: Douglas Anderson To: Mark Yao , David Airlie , linux@arm.linux.org.uk, Heiko Stuebner Subject: [PATCH v2 1/5] drm/rockchip: dw_hdmi: Call drm_encoder_cleanup() in error path Date: Mon, 7 Mar 2016 14:00:50 -0800 Message-Id: <1457388054-23077-1-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160307_140141_177351_2A19A167 X-CRM114-Status: GOOD ( 11.68 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: john@keeping.me.uk, Douglas Anderson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Daniel Kurtz , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 The drm_encoder_cleanup() was missing both from the error path of dw_hdmi_rockchip_bind(). This caused a crash when slub_debug was enabled and we ended up deferring probe of HDMI at boot. This call isn't needed from unbind() because if dw_hdmi_bind() returns no error then it takes over the job of freeing the encoder (in dw_hdmi_unbind). Signed-off-by: Douglas Anderson --- Changes in v2: None drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index 3d3cf2f8891e..88776aba984e 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -293,7 +293,16 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, drm_encoder_init(drm, encoder, &dw_hdmi_rockchip_encoder_funcs, DRM_MODE_ENCODER_TMDS, NULL); - return dw_hdmi_bind(dev, master, data, encoder, iores, irq, plat_data); + ret = dw_hdmi_bind(dev, master, data, encoder, iores, irq, plat_data); + + /* + * If dw_hdmi_bind() fails we'll never call dw_hdmi_unbind(), + * which would have called the encoder cleanup. Do it manually. + */ + if (ret) + drm_encoder_cleanup(encoder); + + return ret; } static void dw_hdmi_rockchip_unbind(struct device *dev, struct device *master,