Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3815182ybi; Mon, 29 Jul 2019 13:09:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqz0LYJiVielDXXEWrMWHrzYYUxnbkVTpj2a7NX8xSw19X9KJANLV2zkxnDO0pYR53mopv3u X-Received: by 2002:a17:90a:3ac2:: with SMTP id b60mr115081386pjc.74.1564430991249; Mon, 29 Jul 2019 13:09:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564430991; cv=none; d=google.com; s=arc-20160816; b=QghntVJu9/+B+7HiVphl3vaV25yg36TJ9BddwbrdEKjebSzQ14glzagEVb8Q28Ohk9 6A7E7VywGnA5HjJIBsyESCswfWzVXf/HZJR7v16wrArgtK7p8zqKInTAFUZlDbf0G61N XUQdlsfKFKrhmtwWpbCX1rmVsB9gx/8JvBmtJreD/wG8wbc6NYmWUgGDXFxNKSQdEa/i QwbPXiCX8VmYiPB8pgqQ4lupsKFytBCTaqr5RXiBTPSAVcoebzJt8NOd5+hQJ526Kg0u kgetxdshbK5uoxIRIgeSDXKyZJ/3YK3Y3lXhgVz3kG1SK8hZGe41RaU1nzV0Nn2vodGa aDsw== 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=v2dDmf+Wiae/z7sumi/zL440+O0HX+1oaXzUdrFKsBw=; b=PGIFY/r8U+ATMz2RF6dLXfr+mGLdFH7MZyOnJhNCJHAxqRXaY7icPCO5JNR/TFsy2k Pe1gyh2NmDrhx7CFmmX5PuWZWILLVt0egsI3+/kPrec4ftYb0ugdVgwpRtYgWB5gCD6z KHAwE5VNf31dH3BbO6EvpV/B3L7iw7BLdmjftVk8+6f0YBeObt1BWRJIhu7MOyiaQ1HW D3Bpek40D/t4F18O8e/lBYA9BVYEGofs2VwRV+EWd4c4npTNnwQ9C4vfE2EQjhtY8UQx sQ7RaR6v5iKs2yI7j+u6bUoezn7dQdBcZnnUz3rcdF6exYlOxx/nM2yBJ/BPefaE5mRm GXbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=J0va2aWA; 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 k10si27900435pjw.1.2019.07.29.13.09.36; Mon, 29 Jul 2019 13:09:51 -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=J0va2aWA; 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 S1729942AbfG2UHO (ORCPT + 99 others); Mon, 29 Jul 2019 16:07:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:55010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388776AbfG2Tjt (ORCPT ); Mon, 29 Jul 2019 15:39:49 -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 86E65217D4; Mon, 29 Jul 2019 19:39:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429189; bh=CQWzI7qtMVxhWNj/HKj6OxlBAtm6dzDS5xrpQ4IVqeg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J0va2aWA8/zGNGFbj1PdBLTQeG3YmEy/+R2YjJXN0YXeQWksrE3+JwpZZL1/NmzVz l//EvusDZKV9Qx+BklAwS4roawbmEemSAlq4ja0jkLJwa0Owz0Zlu4uhjOuRNWNFKJ WxDhUk7GkwJcWaTlUFo3y7BYlSbkMI6E1Ir05Xrc= 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.19 002/113] drm/panel: simple: Fix panel_simple_dsi_probe Date: Mon, 29 Jul 2019 21:21:29 +0200 Message-Id: <20190729190656.234251785@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190655.455345569@linuxfoundation.org> References: <20190729190655.455345569@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 97964f7f2ace..b1d41c4921dd 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -2803,7 +2803,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