Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2818431rwb; Mon, 15 Aug 2022 11:59:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR6yniHZztqfAutBVRrsqOK1HMWxamsXHJq2qgjXhMG/fXuvb2apohnL8e0nSY6vRUQGxbEF X-Received: by 2002:a17:906:eeca:b0:730:6880:c398 with SMTP id wu10-20020a170906eeca00b007306880c398mr11430067ejb.706.1660589978974; Mon, 15 Aug 2022 11:59:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660589978; cv=none; d=google.com; s=arc-20160816; b=BEPutpBw8gjFXZ4T4yB+ycAMZk75y2Dgmfjp4I3SSd6LuZQKRxoEVQ2QPk1HV00rpx KEsSd4Z/5l3QFKu3rm42wbD27zdN/RO7bCLX44ED4EXrV8KNGxB+iomIglBdL3UeD05d 2lKch7FayKvouOgftQ8A6pTtt/anOLLvv/CD2RMirYQKlxlWDI6Y0bHGhvcXa3WZewfB LgBBRlZJFBWAL91GTeWTaTMy3mi1en4wXHIATrK0TxZ9WVFrB1WOHzaCcaONDbNwRcbv 7HEG5lsxafEzzofff3GDVWjvsWdtxR5u2GJFzz9bPxHy+5SVPi4MWnGrFzqowv+rT6zZ VOZQ== 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=/dO6Zh3gQR8m0dMCvaW56BF9yTdAGOZ/+/jhbCMuluE=; b=Ctq3OEh/GvD3bAs/6USeq7NU+zSPReZ9oLLBX/OtVhGjeCW9GN+wCOIcQZaHuhtfEb M4gnMey7ZbdPcxyuXvvZo8g6Wn0ZokPIetzBM9OlYbY+7WhB4MxXX9rjxMXCFSuE5Vgg +zUuakdR7ZjqxYfZjnsQyWvph5TTb1ZfjYnSClqWK/mOMZRonddgS5v1CzCTnLXlkWSU 7LCe+ilVLj1+Fc1G/X8dC6MwKWpU3kgxO5gN3cdTrnrmjS0mLK6o/NWDZ34BFI/v7P/R /L/LrC3vHTWLMY5osB2WarrdmFziNRwnofjMh7kStoHU0FwNVybXNjVRmCSKMPl/3i9J 9qCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1vmfqLdq; 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 e18-20020a17090658d200b00730e93aa2ddsi7710425ejs.903.2022.08.15.11.59.07; Mon, 15 Aug 2022 11:59:38 -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=1vmfqLdq; 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 S244024AbiHOSyV (ORCPT + 99 others); Mon, 15 Aug 2022 14:54:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244564AbiHOSv3 (ORCPT ); Mon, 15 Aug 2022 14:51:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4697641989; Mon, 15 Aug 2022 11:29:20 -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 9BCC160FDA; Mon, 15 Aug 2022 18:29:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EBB5C433C1; Mon, 15 Aug 2022 18:29:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588159; bh=75PJQzjZ5bs1glYwli5PDChBligTr07n+c98BVE86jI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1vmfqLdqNhqzZM0+Ju/DZ/fYgZNB5Sj2tOFuKkdrFZy+X+3SnJHmIkbdXsDnOGAYN WSFxrZ7SOa2tbemv2yEBoDyaB/PgyicMUKwd1FSWDUUgW6Mrdxnz1QQV6k6CYWCmJg AjnC4ZJQUPQFz9Xs1F4H1MAFPbeXhqxBHe5kXqHw= 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.15 313/779] drm/rockchip: Fix an error handling path rockchip_dp_probe() Date: Mon, 15 Aug 2022 19:59:17 +0200 Message-Id: <20220815180350.662255941@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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 ade2327a10e2..512581698a1e 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