Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6481723rwb; Tue, 22 Nov 2022 14:07:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf5N4qLBqBuQVV59Ahmo1fD0UEa1BJmgZT94vu03lzNAsisCcqgn8dCA4V2UGHgEADxGk4ys X-Received: by 2002:a63:1955:0:b0:477:50ed:6415 with SMTP id 21-20020a631955000000b0047750ed6415mr13606785pgz.535.1669154876786; Tue, 22 Nov 2022 14:07:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669154876; cv=none; d=google.com; s=arc-20160816; b=xcxCq9KEzv4aUBNAiSZzuHmvQwcNus/7N26EcQyMqzoXFgIXuBeRBTC/SD3wexn5Bt PCBzanI36tGlaJKL4zzcMx1QTsup32nltD9yioGQ6HQo+jTo7VBHxWuh+6NeWm6HsbNN Q7fl8Blcw0MIL1Eixy2BxgO3GGhJiTCCRppHCnN3VropJpSjfURYv1paE0YVLnrvFZzt lPJnWRaES+LthyZcf0SVlYLfNDPSbr4N8ld0H/17mok4dGjXn7I46SrDfZs76CjkXV9c pKAj7TO0+A4hH3d/RxcZLO+I+53+zge6dwAARWGPgLsH6MN+ZaVRn4PhIsnKqQ2OIm/M N6mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=4kp28g8yam1mkHYuqhFty2v+SsP7ccHMtmV0trmd29A=; b=N71QqWf8JGCJOpsm2fqaYRLGTVQEWlOorYK1sjvV5HFcWE+MEByZZoXKWQfdCAeyU2 nLZ/m/pSB1z/lO4I3tE242CDLNiqkzZLlbRmGre6KH4J5BpjQZ/aGhlj5LjMaj6Y7PEW b317UUi71NghKTS05svdjMVrlzu3QIh/hOF99PRdO4dTQd80EgI3/7uvMuuK4cIrKJ2F nUNuPrYBz7z6j99umzlsbfla8R3aTQCf9KghcevaFOXVZ3G8ac9NUDTHx2Qf4VgDuMXn xtFVKBzDrYI1NX5VnJSbQnD9OLHbYW72BWPtDLTE3WbbdebJecuGy005CLOFOibqx+2P qTvw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p10-20020a170902eaca00b001890f02e96csi9280946pld.364.2022.11.22.14.07.45; Tue, 22 Nov 2022 14:07:56 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234264AbiKVVpT (ORCPT + 90 others); Tue, 22 Nov 2022 16:45:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232517AbiKVVpR (ORCPT ); Tue, 22 Nov 2022 16:45:17 -0500 Received: from smtp.smtpout.orange.fr (smtp-21.smtpout.orange.fr [80.12.242.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F8C510FF6 for ; Tue, 22 Nov 2022 13:45:13 -0800 (PST) Received: from [192.168.1.18] ([86.243.100.34]) by smtp.orange.fr with ESMTPA id xb4oo3s4a8oPgxb4oo5u6P; Tue, 22 Nov 2022 22:45:11 +0100 X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 22 Nov 2022 22:45:11 +0100 X-ME-IP: 86.243.100.34 Message-ID: <253d4aac-62af-15af-90e7-a3cd4bacba92@wanadoo.fr> Date: Tue, 22 Nov 2022 22:45:09 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH] interconnect: qcom: icc-rpmh: Fix an error handling path in qcom_icc_rpmh_probe() Content-Language: fr, en-US To: Luca Weiss , Andy Gross , Bjorn Andersson , Konrad Dybcio , Georgi Djakov Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org References: From: Christophe JAILLET In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 Le 21/11/2022 à 08:42, Luca Weiss a écrit : > Hi Christophe, > > On Sun Nov 20, 2022 at 1:35 PM CET, Christophe JAILLET wrote: >> If of_platform_populate() fails, some resources need to be freed as already >> done in the other error handling paths. >> >> Fixes: 57eb14779dfd ("interconnect: qcom: icc-rpmh: Support child NoC device probe") > > I believe the same needs to be applied to icc-rpm.c. Their are other issues in the error handling path of this file. 1) if (desc->has_bus_pd) { ret = dev_pm_domain_attach(dev, true); is unbalanced, both in the error handling path and in the remove function. 2) clk_bulk_prepare_enable() is not balanced in all error handling paths. 3) the same issue about error handling if of_platform_populate() fails. These issues have been introduced in different commits. Would you prefer several patches, each related to a given Fixes: tag, or one bigger "fix all error handling paths"? Anyway, fixing the points above would require moving some code around. Usually I try to avoid it, because it is not always easy to see associated side effects. CJ > > Also there shouldn't be an empty line here between Fixes: and Signed-off-by: > > Regards > Luca > >> >> Signed-off-by: Christophe JAILLET >> --- >> drivers/interconnect/qcom/icc-rpmh.c | 7 +++++-- >> 1 file changed, 5 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/interconnect/qcom/icc-rpmh.c b/drivers/interconnect/qcom/icc-rpmh.c >> index fd17291c61eb..5168bbf3d92f 100644 >> --- a/drivers/interconnect/qcom/icc-rpmh.c >> +++ b/drivers/interconnect/qcom/icc-rpmh.c >> @@ -235,8 +235,11 @@ int qcom_icc_rpmh_probe(struct platform_device *pdev) >> platform_set_drvdata(pdev, qp); >> >> /* Populate child NoC devices if any */ >> - if (of_get_child_count(dev->of_node) > 0) >> - return of_platform_populate(dev->of_node, NULL, NULL, dev); >> + if (of_get_child_count(dev->of_node) > 0) { >> + ret = of_platform_populate(dev->of_node, NULL, NULL, dev); >> + if (ret) >> + goto err; >> + } >> >> return 0; >> err: >> -- >> 2.34.1 > >