Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3787256ybi; Mon, 29 Jul 2019 12:36:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxrn1dDxSfpcY/lRQHbQRcIST1Ds7g34JX533dSeJgVF0mvVL86svfI53DvTjxl4Sq9ugpU X-Received: by 2002:a17:90a:ca0f:: with SMTP id x15mr67226989pjt.82.1564429015674; Mon, 29 Jul 2019 12:36:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564429015; cv=none; d=google.com; s=arc-20160816; b=nJxvLWK62sJdtRrlcLiOPomXjCHYbBUgWlToBBPrW9mES6WLYSi064iBpwHbc37ZkA 0AGxeXdoMkqZA5NIvDrpZK0TtlTEPwA7LjopiojqsF8zn7CcOQVbp3+I3KkpJFA2wR+V HVAEyn3MkJpPF6m/OqNwBcixo1aBhBKorT5kSvHLo5Hdj4hN4WGvq0U1Qx3ea3T9EG9c qj9huq4eBGNx/K3hazj9jmUqEnmCOt0Ci2NbOL+oLLOFyW1s4PF2OOt7EdXxYk7BbGkI sPGqB0qy4LnxKqTA7t56wFPS5i99cpqilOIuzez/bJNTLGp4V1RnQ9agLcgVUZMypCQG B9yQ== 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=uzvSyp/TEeNcBFR2P9bmYlfYW/eGtPvORF5bx68Pbl8=; b=c1W1zlhQyZMeF7KjnUQZqQqdTC0ZRUBnsRHqVuraoj5R6UiCk/3k0shU3Hm5QJEgup 0iV9aucR04erfbdaOcjlofjZwUVP+GMgr1xgLRalO685GWxCtCvVlyU5waOFkYFC8ju4 wDxLqeTAbKm60SabCrBYn7PFV/mMMi5hp9Up9S5kjpjvIRAqCpyRxfV6bIgd0q2Cqfgv oEEsplhQOtTXzTtHXSyXp72x65XCju6o9DGXPxmqbx9oPFCeJTo5EGazPD33sGBpAFON ItDR8QmKf/5sOyraegljI7WFrmeKXp0SAPvzHo9Fwmhf1kDDvb7HUvwmQLYP+AYNTmrV 2tWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BAPSDoaY; 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 z1si28258196plb.41.2019.07.29.12.36.40; Mon, 29 Jul 2019 12:36:55 -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=BAPSDoaY; 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 S1728870AbfG2TfL (ORCPT + 99 others); Mon, 29 Jul 2019 15:35:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:49488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388498AbfG2TfG (ORCPT ); Mon, 29 Jul 2019 15:35: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 D1E3D2070B; Mon, 29 Jul 2019 19:35:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428905; bh=oItNQuCBrIzotzzr1kf3HZfQj2JsX+W45RM60i8myRA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BAPSDoaYpo7WRzcWhfT3PnqNH+QQbfDpqDsMo4ECAxYq0cytGMxbsOyl9uo8klLH4 rOvHDo+X8jyYdDo6QFr3R+x5/Re6A2HLYxJUEaUt1A5zdQkZwJuMkodUzbhhFPkg2y GN2NJxSELOE/Lfi9GmjQfyXTT/5tz5PTd1HYzN2o= 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.14 222/293] drm/panel: simple: Fix panel_simple_dsi_probe Date: Mon, 29 Jul 2019 21:21:53 +0200 Message-Id: <20190729190841.510554327@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@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 fc56d033febe..7a0fd4e4e78d 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -2371,7 +2371,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