Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1486833pxk; Fri, 25 Sep 2020 16:46:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzqLT8TjnAzTHzoDtr3NRv+7bTBBxYUPH/koXZJyjghIpzVDX5GO61B0666g8hqn2t8I0i X-Received: by 2002:a17:906:af6a:: with SMTP id os10mr5155564ejb.34.1601077587742; Fri, 25 Sep 2020 16:46:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601077587; cv=none; d=google.com; s=arc-20160816; b=clxHumMpNk7loQJDNcrrPjewAS3r7bAq0dv2Y8BHeXMDI3Iyn1teVqJAt0rXB9pMOP loez3RMWnqJr+/uIExUTtRUkBejEiubmnTJpyT5FdeHxPqltFeV0TI92L/aLlwPevdQq 6qhOy0U90xXzNlsV2TCFgCC4G0E5AILlm6+8tRerNsKb1Ik2D7QnHEobX8NNtIGqpyXd yZnhvHxJPFCGwTaZMrimxeZAW/BqptEVHOaE0kTEMfbw0l+xQlKJikF9kUSuGIT2rFBa gkhNInB7E96P+EJh5cY0x1L1n6QPx5Z616kV8skYE7nAsfaBUgLzRu7AqX9Ke4YPIqcZ vPlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:content-disposition:mime-version :message-id:subject:cc:to:from:date; bh=ibj0eTEVOmm4AEOYbCoIIc0HReQxo+HWcNgteJOdv44=; b=Die7Ydfe5uVfd/fpNHFSriSEJ0s9egm87PJ0IKHqVtPH99ROaWL6BVXEFp9LxlONSv MFkUVHmnG/KX7aWB96FRept1IA2BM7uomFQQlGRKCDq85Dtp4FmS3GflXs4onk1M6RVi zQS7v615zr15p/Zatd5FgP1o7wMTUCXOlp+gOu6NxNApMAtDHeMihMcrTW8K9xFtNPsA UCpqE7d5QWj9Vf6Ys4IdegjKw+vpNqD0aTH03Hk6FC+ieKWY1AShrUIyct+BJ4QiZ7Bv QVZICI3bPahSsUXIXEWApsXSA2Ebz/bZQnO6w15e4eZ1JdcTULXAMdjj+W4dgRwyNm7y H0Yw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e3si2894557edr.606.2020.09.25.16.46.03; Fri, 25 Sep 2020 16:46:27 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726587AbgIYXpG (ORCPT + 99 others); Fri, 25 Sep 2020 19:45:06 -0400 Received: from agrajag.zerfleddert.de ([88.198.237.222]:39272 "EHLO agrajag.zerfleddert.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726037AbgIYXpG (ORCPT ); Fri, 25 Sep 2020 19:45:06 -0400 Received: by agrajag.zerfleddert.de (Postfix, from userid 1000) id 293B55B2095A; Sat, 26 Sep 2020 01:45:04 +0200 (CEST) Date: Sat, 26 Sep 2020 01:45:04 +0200 From: Tobias Jordan To: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Gross , Bjorn Andersson , Linus Walleij Subject: [PATCH] bus: qcom: ebi2: fix device node iterator leak Message-ID: <20200925234504.GA18813@agrajag.zerfleddert.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the for_each_available_child_of_node loop of qcom_ebi2_probe, add a call to of_node_put to avoid leaking the iterator if we bail out. Fixes: 335a12754808 ("bus: qcom: add EBI2 driver") Signed-off-by: Tobias Jordan --- drivers/bus/qcom-ebi2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/bus/qcom-ebi2.c b/drivers/bus/qcom-ebi2.c index 03ddcf426887..0b8f53a688b8 100644 --- a/drivers/bus/qcom-ebi2.c +++ b/drivers/bus/qcom-ebi2.c @@ -353,8 +353,10 @@ static int qcom_ebi2_probe(struct platform_device *pdev) /* Figure out the chipselect */ ret = of_property_read_u32(child, "reg", &csindex); - if (ret) + if (ret) { + of_node_put(child); return ret; + } if (csindex > 5) { dev_err(dev, -- 2.20.1