Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp553593pxb; Thu, 21 Oct 2021 05:06:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUARlXxL3wlP7I1qh9OLkjvyjeRPp8HT4OTZ+e9Om18nsdVAHtfP91ywHvCF27pyAHWxp7 X-Received: by 2002:a63:b54b:: with SMTP id u11mr4025173pgo.163.1634817976619; Thu, 21 Oct 2021 05:06:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634817976; cv=none; d=google.com; s=arc-20160816; b=pim69t+OmN3b/99jFbMJopkX23OXMKl0Wu/GrXnkOOlbPf9osyeSxEffPGWsEVNN9N Lu+woCnahOKB8ost8rJcKHjoJDpgch5vA9wYF9yli2v/NzOY8AFwo9njaB4hffniI50D gehDQX25oAOIcgPGynEGl3j9GXvylCRG8+RF9kYBg6pdWeyhfr4miLePo/HpNeX5XX5l PZKTG5yB4K+xBhaWYxxtRqib3wi7MqT1/o4mFmNFmGZjNTKDQqG26Opw5ce7GphriKoP 2uaoWilI7G1n5l495bU7kIqE4lh3/vlsRKx8diCMRqu9HxMebbqndtAG/4hkd/9ruvKA 8Y+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=hvddE42Q9bJ7IvzpAni+KWpr1V0kd9MuytQRIK1sshU=; b=tprkO6NozUOtT2PuVFge858ddJngiRQYWrTFL4Q8IBTnNTPeziJI2Ylwd6Dj7fiEsf OmsCjU815Rn2IDLLKN0N4wbyUhH/xGUcM7MkfhrFDCulAjzw3mbeXYAWoC5Lij2n+DBo j9B7ZH8UA6+VR6OQPYV0Dd84hFROdRF2R8BIYilONe6lYtJvK3UsY48UhkGMKB0POPna OYaKsFh2c3WrJBCiIuI3udm7ksvs58sX2P9GFtWaaiQATuDKVuCc19+kf8VVpJ6TK1Gb 4PioblFDSNn+JwzhKzYJ8xWup5fydcxLV1PgoLJQYuIszXkKaRAM8oRNhcqQmGTKWhBv dZrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b="0WK/cvMW"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ng18si8493080pjb.58.2021.10.21.05.06.04; Thu, 21 Oct 2021 05:06:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b="0WK/cvMW"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231156AbhJUMHL (ORCPT + 99 others); Thu, 21 Oct 2021 08:07:11 -0400 Received: from mx07-00178001.pphosted.com ([185.132.182.106]:45500 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230340AbhJUMHK (ORCPT ); Thu, 21 Oct 2021 08:07:10 -0400 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19L8h2sI007645; Thu, 21 Oct 2021 14:04:21 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=hvddE42Q9bJ7IvzpAni+KWpr1V0kd9MuytQRIK1sshU=; b=0WK/cvMW+iNDuWqG0pNhSG7kEReA9R122vl0mFaH6fKU0vMCD2rEqHgXgVENJhXEQs5p Mm8EF8zrtqp9JVfkNxWgy9PEZVAgwcuz3gsZJLKXutUihuSHg5Wirx8j8rSbtdpOw7gt yxlt7ertC45S1yqJm0Ra+HLmv/CM8OPJRNY83lyUcuiwozKZelgaqFTswqavZIvW0sku JgsCDxF4+1+lMJmJdSoh+jOTNOVJ5i/QJBFV+RF/9qc86HorUtiLmC8uFCDeSGoBwOjB HuAfS8BB0QjqlZUytxDSSk/OnCNosDpXWEZe7Ez+o/2ANbUYi71Qnds9kLlqbZqBG0Kd sQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 3btywkb956-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Oct 2021 14:04:21 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E665210002A; Thu, 21 Oct 2021 14:04:14 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag2node2.st.com [10.75.127.5]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id DDFE821CA96; Thu, 21 Oct 2021 14:04:14 +0200 (CEST) Received: from [10.211.1.225] (10.75.127.44) by SFHDAG2NODE2.st.com (10.75.127.5) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 21 Oct 2021 14:04:13 +0200 Subject: Re: [PATCH] iio: adc: stm32-adc: Fix of_node_put() issue in stm32-adc To: Wan Jiabing , Jonathan Cameron , Lars-Peter Clausen , Maxime Coquelin , Alexandre Torgue , Olivier Moysan , Xu Wang , Ahmad Fatoum , , , , CC: References: <20211021112452.9491-1-wanjiabing@vivo.com> From: Fabrice Gasnier Message-ID: <46423a73-5c4f-84d8-6f2c-5889bc14cd53@foss.st.com> Date: Thu, 21 Oct 2021 14:04:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20211021112452.9491-1-wanjiabing@vivo.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.44] X-ClientProxiedBy: SFHDAG2NODE2.st.com (10.75.127.5) To SFHDAG2NODE2.st.com (10.75.127.5) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-21_02,2021-10-21_02,2020-04-07_01 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/21/21 1:24 PM, Wan Jiabing wrote: > Fix following coccicheck warning: > ./drivers/iio/adc/stm32-adc.c:2014:1-33: WARNING: Function > for_each_available_child_of_node should have of_node_put() before return. > > Early exits from for_each_available_child_of_node should decrement the > node reference counter. Replce return by goto here. Hi Wan, typo: Replace I guess there's no need for a Fixes tag. (I'm pretty sure Jonathan will advise on this if needed). > > Signed-off-by: Wan Jiabing Apart from that, you can add my: Reviewed-by: Fabrice Gasnier Thanks for the fix, Best Regards, Fabrice > --- > drivers/iio/adc/stm32-adc.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c > index 6245434f8377..7f1fb36c747c 100644 > --- a/drivers/iio/adc/stm32-adc.c > +++ b/drivers/iio/adc/stm32-adc.c > @@ -2024,7 +2024,8 @@ static int stm32_adc_generic_chan_init(struct iio_dev *indio_dev, > if (strlen(name) >= STM32_ADC_CH_SZ) { > dev_err(&indio_dev->dev, "Label %s exceeds %d characters\n", > name, STM32_ADC_CH_SZ); > - return -EINVAL; > + ret = -EINVAL; > + goto err; > } > strncpy(adc->chan_name[val], name, STM32_ADC_CH_SZ); > ret = stm32_adc_populate_int_ch(indio_dev, name, val); >