Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2929748rwb; Mon, 15 Aug 2022 14:15:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR5UqZQCn0iQAgNPdi+l8GRE27Q6aURLWC32hYISDHh5YoJufEetf6pcLHebQWkBMQf8l9m/ X-Received: by 2002:a05:6402:400e:b0:440:253e:961a with SMTP id d14-20020a056402400e00b00440253e961amr16194246eda.285.1660598132990; Mon, 15 Aug 2022 14:15:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660598132; cv=none; d=google.com; s=arc-20160816; b=dd16rLX+jCrZU7QgbyFbmaX4aRLMeTfy/B9KLg5IW5VKW+PdZX7WzGO81A8GSvKloX eUa7UOMatfxY1y4IctE4ahvihE2iYQlbUz4EU8AZx/onKPNQBn5VCzsOnW0u4tphqbYw 3iNa4gX8U9ZRnY+v8XP0HYElu7EsHOo0eYemfgb7mLRl55mpLhO6iu0oIRkbtcz2YPyi fZj3TOKO20Xw8sHemOn40ar794QUAe+BTHKA66FW1hUP4e5ZFXEllxxhzWcHiuzr7mCH eZC97p86RpRK4r8DTPEP/DVS78AWqod2pBgEgBcRimBHA37P6Eza6U0/0pnP7TkAp9Zc /q3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IBRiIFqrKnPws+v5lAb55dxAe4a4soqS8N7aIKub/sY=; b=srNNqjuE0lhhk5vfj6lV7tbvZpKtCF2ICAoZPnHwroIwgxTumNjN99jPNorAJ30r/I GQCVlxFC0LfoREUZ5ujIbZIyO8Zw2y+mrsqyXJSJBy1yyBHO7VjHwnqCqqc+EAEJ5OAg qKsrfpqAtpxQs8IQWuavNVJSoUiWzPDHeKR3ZCzM2CzIb91opJpS5cx3LHuoJzq3i9fN yxPgNMrWITrvSCYfbp79gzbdUMJVjqHh/Ls87YMF+Wfo0ZxJ+he9PkkuTW2+yBQxVgve OrgYwlbUZtJG5qrSblkK0QmELgRwYs6niSYvKd3o+79zIAbejicxnhI/N3iJhec4/kez KILw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1SJb5p3d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp5-20020a1709073e0500b0073182a31719si9644193ejc.37.2022.08.15.14.15.05; Mon, 15 Aug 2022 14:15:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1SJb5p3d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240593AbiHOVK0 (ORCPT + 99 others); Mon, 15 Aug 2022 17:10:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343939AbiHOVFt (ORCPT ); Mon, 15 Aug 2022 17:05:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EF98D5DC1; Mon, 15 Aug 2022 12:15:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B10ED60F68; Mon, 15 Aug 2022 19:15:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07032C433D7; Mon, 15 Aug 2022 19:15:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590909; bh=RobEPk0ktDvBzpclkbB/iJ3rx8WyTbt0060Tx09Tb4k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1SJb5p3dePnUNfEQq/DUsXZxjpwGKAzZI0XeqZRyAsDPDy9RpS+kUQKY8ii1vnfq4 nTYQK6Lyh/4NmEEqwl7FtV3vpm8W0CNrz5dbTdubJoTMosncj3zvzcszWvM4MJdcYa Lf+AsOkrilaVfSgUDfa4Tw7y4LlvZrjvsZoizL1Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Heiko Stuebner , Sasha Levin Subject: [PATCH 5.18 0410/1095] drm/rockchip: Fix an error handling path rockchip_dp_probe() Date: Mon, 15 Aug 2022 19:56:49 +0200 Message-Id: <20220815180446.673524098@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET [ Upstream commit 5074376822fe99fa4ce344b851c5016d00c0444f ] Should component_add() fail, we should call analogix_dp_remove() in the error handling path, as already done in the remove function. Fixes: 152cce0006ab ("drm/bridge: analogix_dp: Split bind() into probe() and real bind()") Signed-off-by: Christophe JAILLET Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/b719d9061bb97eb85145fbd3c5e63f4549f2e13e.1655572071.git.christophe.jaillet@wanadoo.fr Signed-off-by: Sasha Levin --- drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c index c82901d9a9cc..8a9bb618f872 100644 --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c @@ -398,7 +398,15 @@ static int rockchip_dp_probe(struct platform_device *pdev) if (IS_ERR(dp->adp)) return PTR_ERR(dp->adp); - return component_add(dev, &rockchip_dp_component_ops); + ret = component_add(dev, &rockchip_dp_component_ops); + if (ret) + goto err_dp_remove; + + return 0; + +err_dp_remove: + analogix_dp_remove(dp->adp); + return ret; } static int rockchip_dp_remove(struct platform_device *pdev) -- 2.35.1