Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1667250ioo; Sun, 22 May 2022 23:40:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMTmMgajJcEFavPqGhbOCE+Ei24rzmXE1NSTg0xrGWwtG/hXU84ZA76Jk8JIiLViU0IeSW X-Received: by 2002:a05:6a00:140b:b0:4e1:2cbd:30ba with SMTP id l11-20020a056a00140b00b004e12cbd30bamr22245069pfu.46.1653288012067; Sun, 22 May 2022 23:40:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653288012; cv=none; d=google.com; s=arc-20160816; b=VUns7mQalpNueu+tsED5oupOIsvtGtYEUMfVIQ+Lp1KYVpPVFRxvXgA6FWk9kB65hd UaBT45IhEzbRys1kS88ymw/KtxAdaEeyFj38q+h7B1XkMNnjviZxIU3giiMQPPcHrgSp K13UklnbZUlqHk0atSvpqvhGZbvsS/dZ/zYWbplmZJ8iF/Ecwg9jMSmWrNJNfk1hSocx AV75fbi+ul62w8Bxit+E63TK9rnYo0BiDx6o8LmNIdp+j6YZmS3KRIAQvt+alOcdS6A2 6XY4BcZbHJJf+Gsh7hD8ctGbhakRg2expQkWeDF2gQPRe5iP6VVw8U/WSQLs6+gWiV1E ljlg== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Jy7Vw996ow7erS42wU2HwOE0o3fbG9qln7TBjtZxEKE=; b=YsFm01SNME79j6nLoNLtmprvXxR5WdSm5691G+t7/VvBSHs2vf85MguSBO7DSPhfnj bW6CJ2AxkWLUC1Huq0lzrvxOnMha4N4F03eUG3inYNVbDkhUexoKy1GkwAFRXDcog8Fx 6yUV5qVZIEEF0csMiWzjxcFqCGEGk/tQWNaZvqCfkpohBy7bJQ4bcxlYBKIxzLRBq949 n1BB5Mc4XoQrcTb5JK/1bkgkZ0bVqPQ2bcULygRIptR+QNPMf+B3X5LWkjgIqnqh1pQf 2TLYXVXtwvnTmwJuJTO1iIpPHbQMbZ6xnhys6nL+MX9Kh/3hZ/bGdrFUeUdm1lZOj4kG y4iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Kfl1qSvG; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u11-20020a170902e5cb00b001617ffc6d21si10679574plf.2.2022.05.22.23.40.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 May 2022 23:40:12 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Kfl1qSvG; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 208E92C643; Sun, 22 May 2022 23:12:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245006AbiEVLXr (ORCPT + 99 others); Sun, 22 May 2022 07:23:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235232AbiEVLXn (ORCPT ); Sun, 22 May 2022 07:23:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F48119C1B; Sun, 22 May 2022 04:23:42 -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 ams.source.kernel.org (Postfix) with ESMTPS id B482EB80AC0; Sun, 22 May 2022 11:23:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D7E6C385AA; Sun, 22 May 2022 11:23:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653218619; bh=9f2iXwecnVb772Z2NNfbPH7l5LuCIfXWdWIxvNZiS0M=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Kfl1qSvGcByxwj7QROpVX0BF4U1anyizOZLZ2xw+qaueFsWlDCPyvNqZ59RZGjTq3 daQdvN/1sbcS7u67LYlCVKsyXeVc4JkLCXiyvx7ogvR7zOTzn2hcB8B2e+hX3dMEqu nx67UBDHLUqIoBVN3MRhgj1U/BsNb9+ffmNQIwbckpO6cVrBuGTHGxDrcW8BfIZOsR r9UinJa5FNxDWBPipEGYvGP+HOQXuZ2uDSelKLHH1KA7vEsW9iRJCxqY3Oq8i/vfc8 NrE+zh/NPMpRWsHzBmqQKaZsZ2TblIE7iiISt9UAYUb2jn1aNskBalqhYzcDQZQWYw syC1GNmFh143Q== Date: Sun, 22 May 2022 12:32:25 +0100 From: Jonathan Cameron To: Jialin Zhang Cc: , , , Subject: Re: [PATCH] iio: adc: ti-ads131e08: add missing fwnode_handle_put() in ads131e08_alloc_channels() Message-ID: <20220522123225.3f948d5e@jic23-huawei> In-Reply-To: <20220517033020.2033324-1-zhangjialin11@huawei.com> References: <20220517033020.2033324-1-zhangjialin11@huawei.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 On Tue, 17 May 2022 11:30:20 +0800 Jialin Zhang wrote: > fwnode_handle_put() should be used when terminating > device_for_each_child_node() iteration with break or > return to prevent stale device node references from > being left behind. This one seems obviously correct so I'll not wait on anyone else looking at it - still time though as I won't be sending a pull request until these have been in next for a day or two. Applied to the fixes-togreg branch of iio.git. I rewrapped the description to use longer lines. Jonathan > > Fixes: d935eddd2799 ("iio: adc: Add driver for Texas Instruments ADS131E0x ADC family") > Reported-by: Hulk Robot > Signed-off-by: Jialin Zhang > --- > drivers/iio/adc/ti-ads131e08.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/drivers/iio/adc/ti-ads131e08.c b/drivers/iio/adc/ti-ads131e08.c > index 0c2025a22575..80a09817c119 100644 > --- a/drivers/iio/adc/ti-ads131e08.c > +++ b/drivers/iio/adc/ti-ads131e08.c > @@ -739,7 +739,7 @@ static int ads131e08_alloc_channels(struct iio_dev *indio_dev) > device_for_each_child_node(dev, node) { > ret = fwnode_property_read_u32(node, "reg", &channel); > if (ret) > - return ret; > + goto err_child_out; > > ret = fwnode_property_read_u32(node, "ti,gain", &tmp); > if (ret) { > @@ -747,7 +747,7 @@ static int ads131e08_alloc_channels(struct iio_dev *indio_dev) > } else { > ret = ads131e08_pga_gain_to_field_value(st, tmp); > if (ret < 0) > - return ret; > + goto err_child_out; > > channel_config[i].pga_gain = tmp; > } > @@ -758,7 +758,7 @@ static int ads131e08_alloc_channels(struct iio_dev *indio_dev) > } else { > ret = ads131e08_validate_channel_mux(st, tmp); > if (ret) > - return ret; > + goto err_child_out; > > channel_config[i].mux = tmp; > } > @@ -784,6 +784,10 @@ static int ads131e08_alloc_channels(struct iio_dev *indio_dev) > st->channel_config = channel_config; > > return 0; > + > +err_child_out: > + fwnode_handle_put(node); > + return ret; > } > > static void ads131e08_regulator_disable(void *data)