Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3124236rwb; Mon, 15 Aug 2022 18:43:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR5cRYJDQJERLaUloiJEcAQDeyJ6zNU3ZMkwkg+FWmzXfrQQJ1RfDygmoOJcJGERRZ9aAc56 X-Received: by 2002:a17:907:2895:b0:730:9711:ad60 with SMTP id em21-20020a170907289500b007309711ad60mr11785103ejc.159.1660614229425; Mon, 15 Aug 2022 18:43:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660614229; cv=none; d=google.com; s=arc-20160816; b=036tF57jQJHM/hu9EaAhTu2I0PL3CR/0vT4vjMt2Lui6AGay054eJJ7DU6XwQQ1uIf tZEiLQ7EBVdd+O3qhPC4prkUHdPTcmCk6CNrQ6/AhtCUkcqIa5scCajtquisVTPTR1Fc PC3+QQmsXJGANGMpPGL4FM7g3/cXSmWawtE0xtXpXXGklnSDcCjVQWeBLgbQv80Kmp9x UuY/bUHL/Ahw8Rn5Hf/otr4iiZWsPpTcgc3lQCH4f3gTH+VDvrgNs25aeLs/i2j14BTA VbV6IYFCQYFG5dvwW0MwjjPUYkMHpEvqRVLTonXp6jujeoF5HZveTwpqT5IXkcvcdHGb XAww== 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=gl8dz1wuK1YxXr1Moqhtsv27o/ClEUT0ieCRZ+nhz04=; b=OYzzf/N2qbzSmBj7aJ6QSjlyPmqRSdNtuhgIQTv73gZFL3o8DVDJm7Crm07qJPe8d4 kx+w3Hs3EZAm0msXT7cnEBQClaK7QfuZRLFLsgD0gLBKBuqtIG791FK6s56GbAEhFtoR T9jeBoIlFBE29veUWFlMk/LJuTb2q9LwVXlm1u8zFIps3iVO4Skn7UYC6FmwWWC7tl31 KifofOdK9mpj4CVP/1Kp1a9xFVgwNHNaAy+Fp/NKbfnMuBx/FfP88x6JIotyWvIi2a1z lkK0vK983KkI+8fiIG48Y1JmpMi09ca1LOLccwZmFDQ5lkCO0YWVkzMvoxbUsW94H8AX hKNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HNZN2Kt+; 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 dt16-20020a170907729000b00708f4d9dbdbsi9130769ejc.79.2022.08.15.18.43.24; Mon, 15 Aug 2022 18:43:49 -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=HNZN2Kt+; 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 S1354339AbiHOXrr (ORCPT + 99 others); Mon, 15 Aug 2022 19:47:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354369AbiHOXmA (ORCPT ); Mon, 15 Aug 2022 19:42:00 -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 80BBE326F7; Mon, 15 Aug 2022 13:13:21 -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 CDD4F60B6E; Mon, 15 Aug 2022 20:13:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C173FC433C1; Mon, 15 Aug 2022 20:13:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594400; bh=O32KjmjGtEz5kxgsoDsuRehpZm+3m/s2m5HKJPyj5pE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HNZN2Kt+hnTvwVSDsw4UEmMvjFPEsrC8Y+62GRgMKp3n0odwMwJ/D+L32lSsxdfui ndzKt2C+kqD8OomK9ZIEVNYpbBcwx7mnya8AHa5jxLrRJG8FvcMPXUN/WfjSWnEI/I cXkieBYhmj7A53GmsJRXp8m7vnetzE36YQnrnxyc= 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.19 0433/1157] drm/rockchip: Fix an error handling path rockchip_dp_probe() Date: Mon, 15 Aug 2022 19:56:29 +0200 Message-Id: <20220815180456.972800173@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 70be64ca0a00..ad2d3ae7e621 100644 --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c @@ -408,7 +408,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