Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp856915pxb; Thu, 25 Feb 2021 17:43:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFiuNAe9Bbot8+E1/PIIdCoIDpTtcj2irU++pWN2nJHzTVCHh8Y5ut7qzUpn2GHpnVjXr2 X-Received: by 2002:a17:906:2755:: with SMTP id a21mr611621ejd.374.1614303782130; Thu, 25 Feb 2021 17:43:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614303782; cv=none; d=google.com; s=arc-20160816; b=IajEHD4VZdQAtwWXZq+H1ZrcYAI9l+hh7nb3sXALDH2MZc0mx7fOL7kCH51pZoDdqp +a5as/z/lLPWur4VQ90JvJqNEG3UtyziJLLgLbqqlzQw2WDCOerIY9pkoCTaFzpBjrlE F3s3JQSmXbBYMO5RDEqDQ6Io29Jp9oenSr7V3kQPixo1h+zN1ol+IuL2ledc+ZmCMo4M zfoyk0UYomhnRGXnyEqTCCPXE4C0oOU8QpROQIxYFr4kB8s45J91gGQs5as9P4ps8nna J3Iv44vNBk9wDjYq2nHUs2ULPZWnFY5D9kclSr+z5eK5Lv4IKnvXC4LPuWtcpuIWkg/k eg+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=kLvWXwNBmK4FoplHtTqv2mJFQ+enPkIVxqEEWTAzK8k=; b=iXpS9BvZ803BDAXbTsj98GSzbh7SjHGzOx5yITdTsvFZNAthhKqYTC1UMHdBHGhGKB 8TbhHj1ugYIFzeUaKLS9QjrQFtRXYEiXHpush8X9b90XiJc8+tAuF1CHYsCxCgpYKP5X eNWfyS9B9p7MWXKo65OOfDP2GTyMMa2bZU/P4vr1UB1aXY7gB8QYW6LDvAqAnEHgnD9N jSwNN04otCLOBwrghkQEyy+JOzbvz4fwdXmnlZmquoIzS1uKPVxdzn4RM3YDn1OwL3g3 IqFhCJEeqkhEqzrHc8XNwjemK850y1PtMqkNRuxKiZ49wFYkfH0cny7PKMHNN76fVYTd ST3Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j12si4717881ejs.117.2021.02.25.17.42.39; Thu, 25 Feb 2021 17:43:02 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230010AbhBZBkV (ORCPT + 99 others); Thu, 25 Feb 2021 20:40:21 -0500 Received: from out30-131.freemail.mail.aliyun.com ([115.124.30.131]:47091 "EHLO out30-131.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbhBZBkT (ORCPT ); Thu, 25 Feb 2021 20:40:19 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0UPaXUWV_1614303577; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0UPaXUWV_1614303577) by smtp.aliyun-inc.com(127.0.0.1); Fri, 26 Feb 2021 09:39:37 +0800 From: Yang Li To: cristian.marussi@arm.com Cc: sudeep.holla@arm.com, lgirdwood@gmail.com, broonie@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Yang Li Subject: [PATCH v2] regulator: add missing call to of_node_put() Date: Fri, 26 Feb 2021 09:39:35 +0800 Message-Id: <1614303575-27436-1-git-send-email-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In one of the error paths of the for_each_child_of_node() loop, add missing call to of_node_put(). Fix the following coccicheck warning: ./drivers/regulator/scmi-regulator.c:343:1-23: WARNING: Function "for_each_child_of_node" should have of_node_put() before return around line 347. Reported-by: Abaci Robot Signed-off-by: Yang Li --- Changes in v2: -add braces for if drivers/regulator/scmi-regulator.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/scmi-regulator.c b/drivers/regulator/scmi-regulator.c index 0e8b3ca..a917c81 100644 --- a/drivers/regulator/scmi-regulator.c +++ b/drivers/regulator/scmi-regulator.c @@ -343,8 +343,10 @@ static int scmi_regulator_probe(struct scmi_device *sdev) for_each_child_of_node(np, child) { ret = process_scmi_regulator_of_node(sdev, child, rinfo); /* abort on any mem issue */ - if (ret == -ENOMEM) + if (ret == -ENOMEM) { + of_node_put(child); return ret; + } } /* -- 1.8.3.1