Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3866157pxv; Mon, 19 Jul 2021 10:37:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkkGw2PafZqgMa8Js0Qz6lGfVFGOQWW5FU+3ut5JgE6ldtbi8BmX+DqEPNoXC3H+KVWAJi X-Received: by 2002:a02:93a7:: with SMTP id z36mr22523981jah.112.1626716241688; Mon, 19 Jul 2021 10:37:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626716241; cv=none; d=google.com; s=arc-20160816; b=vphK8iUkazsPC4F18jBiXNzRKlABHXMrbArUNUHlft22N/yjpIkAcBzPOF3JOeuT7+ GJ8hBCfHyC4SYE/8PVDjpaXrcKSsOvg2L10QofY/4BGcP0D6lY1et52J+KWiqTs4AvEP sU9fbsgtCcMFY29lTMYSLnJ92JajsQkv2FklBkjydZu5QVaiCs7n1iVM2PvbubtB8INs ldOJT1BfoRN3LUymi3FqV+CfFwfp3E/ug1IVKhQCkLkN3J6kRiCQ2blQRIwJbZ9vN48k yqglkRZjldT9bAOd+CmJNImvouTcTXGS+mOyHq/bP9HjFCKvxrlfX0UwzXDVdarEosFt U6kw== 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=roOhidx2nFLb/qpmDO7brD6N0WjBIwlS9CJygsK4mTE=; b=CXymHC8QxCV9h8euamK5zcFRJgG06NGWw6IHuBw0/nAZXfmLokESjD3Ld96B8rm2xF Q3P17xW1pTsyyqHqNNyE253o1MWIkOlRkM7+vzHxzOjIp2OtdF5Rexe99zkiIuO1d0up 1d0tkElzObW2o5z8doCk1Nkh7tYPE2U8otFZuuSO/xORcV146f+J0tZLoU8c+K7mFGEF q8dMWVDOPT3Y/BYsddBUtzozIjwQ44eXJUYUkNXw5Wb/o8vMNpwJwgUDfLlGQ7xayB9O RME+PdxkGDbBhxdYuNxt3qFt/4RYrZ5fDYWzqg5EHLBRJZAj+Amw46uqrk5xxHWUquCK XdYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Ok73/GVS"; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t11si21876045ils.106.2021.07.19.10.37.09; Mon, 19 Jul 2021 10:37:21 -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=@linuxfoundation.org header.s=korg header.b="Ok73/GVS"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357728AbhGSQwQ (ORCPT + 99 others); Mon, 19 Jul 2021 12:52:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:60842 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347860AbhGSPWL (ORCPT ); Mon, 19 Jul 2021 11:22:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3317B61283; Mon, 19 Jul 2021 15:59:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626710383; bh=O/XLNs45j5AW45fZa8ttvzotd2ITvBBHqU3XmX5lFqk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ok73/GVS8tVRL/UpZJ9aWjErtlrvFXxPZySLqk/qb608/EYoAWCnF3bZ6Ph+6BueW vWYcM98AeFUL0ghZwQ1zSeqZzI5F3u7xdEvc/fxjuf2XS61j+qoFoQRqcV3rUb4QlJ HhLKtkbjp21VKPziA5n1y4+u6asX01al0Bqr3mMA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Christophe Kerello , Sasha Levin Subject: [PATCH 5.10 194/243] memory: stm32-fmc2-ebi: add missing of_node_put for loop iteration Date: Mon, 19 Jul 2021 16:53:43 +0200 Message-Id: <20210719144947.184009442@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144940.904087935@linuxfoundation.org> References: <20210719144940.904087935@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Krzysztof Kozlowski [ Upstream commit 2f9dc6a357ff3b82c1e54d29fb5d52b8d4a0c587 ] Early exits from for_each_available_child_of_node() should decrement the node reference counter. Reported by Coccinelle: drivers/memory/stm32-fmc2-ebi.c:1046:1-33: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before return around line 1051. Fixes: 66b8173a197f ("memory: stm32-fmc2-ebi: add STM32 FMC2 EBI controller driver") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Christophe Kerello Link: https://lore.kernel.org/r/20210423101815.119341-1-krzysztof.kozlowski@canonical.com Signed-off-by: Sasha Levin --- drivers/memory/stm32-fmc2-ebi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/memory/stm32-fmc2-ebi.c b/drivers/memory/stm32-fmc2-ebi.c index 4d5758c419c5..ffec26a99313 100644 --- a/drivers/memory/stm32-fmc2-ebi.c +++ b/drivers/memory/stm32-fmc2-ebi.c @@ -1048,16 +1048,19 @@ static int stm32_fmc2_ebi_parse_dt(struct stm32_fmc2_ebi *ebi) if (ret) { dev_err(dev, "could not retrieve reg property: %d\n", ret); + of_node_put(child); return ret; } if (bank >= FMC2_MAX_BANKS) { dev_err(dev, "invalid reg value: %d\n", bank); + of_node_put(child); return -EINVAL; } if (ebi->bank_assigned & BIT(bank)) { dev_err(dev, "bank already assigned: %d\n", bank); + of_node_put(child); return -EINVAL; } @@ -1066,6 +1069,7 @@ static int stm32_fmc2_ebi_parse_dt(struct stm32_fmc2_ebi *ebi) if (ret) { dev_err(dev, "setup chip select %d failed: %d\n", bank, ret); + of_node_put(child); return ret; } } -- 2.30.2