Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1038499ybi; Fri, 2 Aug 2019 08:20:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4RvZ5/w3clIwQfUv+ohZ9b3y9HXBe20OKeIsZUkWV3+lCFWGOJEiypr7qpldaRP1hJRMk X-Received: by 2002:a17:902:7781:: with SMTP id o1mr131694120pll.205.1564759226761; Fri, 02 Aug 2019 08:20:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564759226; cv=none; d=google.com; s=arc-20160816; b=u0c5zur6LkVYXoaleJg5WWASmKpujgkN8ZnQXbWQf9U43pPYrG/BFtEXZTSVrXWdGy ZVQnJS6gxNF5azrA/u4OPZ375RsivM/ctHe06UssN93DxEi3JUE6jNyG3e9a1TQNQTuc 2BU09oG5A3smsTFdmQkJQ/hGNtDaVrjhLWMHY9RLmvL7U4i1afIhVyBshJb42aqltHWJ 7yUea/m4DcE6atR5oIhDjWhjW9xtCbDHDpZmkeOb/64v0w9K2p6OzV4Cqte0iQl2A3kM dvvC4YKf/IUa7MygCDZA8ioQHWBtJbhbDd6UfHIBwpaxI5stFWRAjFzm297MDtXHx+nW 6axw== 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=rnvmUu6MwplTMPk5vQnguVlfixp8AkZcq+r0ZOoUq10=; b=rz5nGeEvjK2gg4vD/rDZzF6062RN9jjzlKZlscpx4/2rLxsKqz0IbegfoFXVcGWMP8 ScD4nkvcHL+6xvdQwkvf2qMneH1EMdSZGK7vH/rgdqQNM8bygXxIGG7dBXdeQwWYah8b DEjrYPbcLuZrmhDf/iqX0dXQ8/VkhLGbRKbIEJrwbpp9JW7g5qz4m+EFgmWRfMhelRqp VO+y6ktrpjGxX62jWxdxAyRNm+IVyuqlQlYiaZrplalO2OTdXwI0XHv9TSHx84LOgtOV jE9rqKlTZ1QpQAhx35ZFDfdiA5TK/vPNuoPXwME0ZdHtfI5QW8wLMP6UgqpC3/VCOxmq CsYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=W9WlkOK+; 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 v63si10121246pgd.111.2019.08.02.08.20.11; Fri, 02 Aug 2019 08:20:26 -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=W9WlkOK+; 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 S1731143AbfHBJew (ORCPT + 99 others); Fri, 2 Aug 2019 05:34:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:34912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391567AbfHBJer (ORCPT ); Fri, 2 Aug 2019 05:34:47 -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 97DDD217F5; Fri, 2 Aug 2019 09:34:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564738487; bh=ocQmBY7ln6jzENd+ILNFkARdD73rtI5W8ETL4JwjVkM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W9WlkOK+4DKefVdhxYuX+u6IDlUgPO9yYYjbOczeUos5o0yVucJhQg7fsoORBdSk2 pgdqURuZBel/xhezLgJFuFKGpTiPGSSMShagIKLzH2THde1Q1NhyIiq5xX/2MiZ9m5 iM6P6ImRkPWKdtvvSKLN1+br5rxLOCVyL6GqOexU= 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.4 106/158] drm/panel: simple: Fix panel_simple_dsi_probe Date: Fri, 2 Aug 2019 11:28:47 +0200 Message-Id: <20190802092225.889845082@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190802092203.671944552@linuxfoundation.org> References: <20190802092203.671944552@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 f418c002d323..ecad4d7c6cd1 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -1389,7 +1389,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