Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1167396ybi; Fri, 2 Aug 2019 10:24:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9bQD80qgcSsONGUjFqNXLfpcOVRTLMBAw6utazcGo7KNciI5Nh5Zo25A/GzyfilQyaN1s X-Received: by 2002:a17:90a:9604:: with SMTP id v4mr5275472pjo.66.1564766679002; Fri, 02 Aug 2019 10:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564766678; cv=none; d=google.com; s=arc-20160816; b=jae/mB/O9NzwS6RBR3dpm35vtfrjN/jvzPWZdUlm0qfkhsaf6zeZF3foOpWMMgipWr cruyYfV00PzJahkOrC4BSoJLtVlgAJ5ixgyu4lQRdW8T8vcOW0TvbX6MDgf1BLJjgWdH mxXIyUSEfmqBLXNwP3Cdxt4C+8UXApF8lR37e3pWzdF/a4MB09ChS1mcq6vuEwehb85b C2aMz8t3/jgJaThC0QdNa/5/fGcDENHz1BJpU4jbGjX7KLP9GwxXlCk2vzbJ4G6NjmaI PndryZLm74Yl9Lqr0QNaudUKrcDyBdgc+s9mMqAT6c8tanm9gXQ/sFjeZDaasnMW6jpe Arww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bmW633HfUE04p+C6YXV0R4hQ1KUmLZX/Mo8XgFVj+R0=; b=h/RCADdSKO7qaQbe0mOqO/jrpbHNdULChrK35z7Nw+iO7IG3gM/x93rkBJWqrZSK8k ewOTNhcbeL+51qTN9TUFiCstOhSDB9TzJd3Ee8zq1HtXb0RrGrZhBDgfu/46vGocDrCg scFVEnrpwvXxJ9jL2HE5tc2MruGjkz89EgrQv0mUFi45AcLlYViF3+FqWVns1YW7YkdX YX4pkZamXMLntbgeHcuKlIpNM61fYAmQdQG+8aTrP5A23dzoloSQqICOPPk50ghgov/M 8K3E6z7/qL7KtgtRJtlXWS7Kl97n2nUs0op8sUjZiGCLLSby2PBulk8Dtv+4xG832MMi wyqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Sm4Orvxa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id be11si34799907plb.218.2019.08.02.10.24.24; Fri, 02 Aug 2019 10:24:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Sm4Orvxa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405634AbfHBJrI (ORCPT + 99 others); Fri, 2 Aug 2019 05:47:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:51798 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392087AbfHBJrG (ORCPT ); Fri, 2 Aug 2019 05:47:06 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A4D4120880; Fri, 2 Aug 2019 09:47:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564739225; bh=gcPTCB6UpU4DCzvcOK0j830FQAAPxgXOUQAdiBKoRKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sm4OrvxaeDZC2h9/7F5iiZCa95cS/zgsxDYRu3x1SXtTFQXdt39UJLHh3UKB2UsCh R52z/m7Fqdih5NCjzgBoTgy7w35X2lG2ZbVSdZx5M1dsflfnrz5FF2doELQQ2g8Ej/ K2fuKI/EV/5n/S/BW1yWBBrWJt1V+Up2weDRYq/Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Ujfalusi , Thierry Reding , Sasha Levin Subject: [PATCH 4.9 159/223] drm/panel: simple: Fix panel_simple_dsi_probe Date: Fri, 2 Aug 2019 11:36:24 +0200 Message-Id: <20190802092248.550530661@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190802092238.692035242@linuxfoundation.org> References: <20190802092238.692035242@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 7ad9db66fafb0f0ad53fd2a66217105da5ddeffe ] In case mipi_dsi_attach() fails remove the registered panel to avoid added panel without corresponding device. Signed-off-by: Peter Ujfalusi Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20190226081153.31334-1-peter.ujfalusi@ti.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/panel/panel-simple.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 5b2a9f97ff04..68a2b25deb50 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -1944,7 +1944,14 @@ static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi) dsi->format = desc->format; dsi->lanes = desc->lanes; - return mipi_dsi_attach(dsi); + err = mipi_dsi_attach(dsi); + if (err) { + struct panel_simple *panel = dev_get_drvdata(&dsi->dev); + + drm_panel_remove(&panel->base); + } + + return err; } static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi) -- 2.20.1