Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp280683pxk; Sun, 30 Aug 2020 03:08:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxttQucSifgtZifm6VyRNxd12SPl3crbnvyWpYC19J+6ss3kkgV7wKtKpp5QElQGxoUyzgX X-Received: by 2002:a17:906:edd6:: with SMTP id sb22mr1570806ejb.499.1598782136253; Sun, 30 Aug 2020 03:08:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598782136; cv=none; d=google.com; s=arc-20160816; b=a5x8UsGYrrEpAd0ARZps0jh+x53bS416oi9qtHjbhBFVnjIg3gSeeyZtUT9ZvJXOcd KWZSuU+5K7fVZDXavceNfrkqpYE9AeINn30AOP00pZ6c6gTYB34eIWiMf9bHY+asKSd+ i84d3ksJ+qNfJq+/sNwlaaGH/ov5+JFeWDk1gqUGQlfdRMhOgd9Nt24OR4dUASUkn0j4 AocK9U3HpECV4W5gClSFCr/kSbKdZA2eG7M6heE4Ll1IFsVu6LzWKtO5lTa3eOZoXh+j TZTsy0XfmQ1GpVNFpx013aZQPZ0LlroDcuJ93KYbV7qnauxDMYyl7NyxAB+uTGmQtLuM BqXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=dNsRAqkpb7LZUriy3bYigquvN7E89ZUZ6a0Kz5iQgtM=; b=LhAxa3A0XmHy4LxWZ1fWEmm4dzNaBnXmqNPtIMarB5ca44iX/8BPnOTmUO3f9PcZJx 0CkM+6cSYQB8zKIpHG4Je45BAQ5VezI8RPUnI3GdtroesUqfm/uEXIlImBSX4hkyceFj lSvoAiTm7GsDct6iplxd/OdAwxcS3MMwsJdc2Z9YKmKpCQF2lQ6XOvQDMI3gJv0mi+MG 5IsHp4MoCJckPZB8LgGQJh620jWL0pVBQahZonoJ7DQoyriqPV76gaqeuBkSsn4stJYT 2yydIvS9mVGVDXTvQ7c/vOV+TPifCAhSAAZLT4v64OGIcrxxeqlLymboAxe8Zb0fOLQY lCtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CR3yBp4e; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o25si3610278edz.124.2020.08.30.03.08.33; Sun, 30 Aug 2020 03:08:56 -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=@linaro.org header.s=google header.b=CR3yBp4e; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726493AbgH3KHe (ORCPT + 99 others); Sun, 30 Aug 2020 06:07:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725869AbgH3KHc (ORCPT ); Sun, 30 Aug 2020 06:07:32 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43340C061573 for ; Sun, 30 Aug 2020 03:07:30 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id y26so1945372lfe.2 for ; Sun, 30 Aug 2020 03:07:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dNsRAqkpb7LZUriy3bYigquvN7E89ZUZ6a0Kz5iQgtM=; b=CR3yBp4eF8gKwB94L2+Av9mspgjaQGAeGq8CagVhQyQcSS5sDkiA2Bjkxows0LNG2W 4VJM2kNR2Q0MBPpzOfSI76DXw5f7LvJXSGK8S/ZN6mk5H/JThx0Wul6RUWRMnN2ePUV8 wYqyQaOVOjcBHxXpGUR6QyvtTnW1WC0ajzsCqO2cAJ2xBGmAWFSlBtb9pocP+iO3dHFr 40a24lVcbeYwulKpH71uhXLpncipggPnqzjR66SE4NbEMtd71/V6df4WmmBgrdwnSjU9 nI6teYtkcGSIovCkUWdL8z2XWKmsrPX7+eij4chqEgYPUWlLhUil66KToCQKok5boyB+ WnZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dNsRAqkpb7LZUriy3bYigquvN7E89ZUZ6a0Kz5iQgtM=; b=k9wXtIUgR+9v5puWY+iC8PA/8YSagtAgZZR3jQW8X5nUbiiPW9mikAMsBAOL7tGJKt VtjQ5s7HsFNCn2F77k3uzkoXs/WPcoa+PHaNFYSdFESaOlZFzNUew48ZNthvtxMEwBq6 TOriUoB8psGbBmf4MLX2Nn1BpJupjrTtWNRqKkdK8S0XckmKaqfYyH2JMpks9MJ/KZ0i d0gLc/J3xt0JZBTUFMmSkhmrKg/pH0E9wAsTwRMaBSN22CdrFJoZxl+GG1+O+dDV8Flr te98u35D6qG8H/vGpXeo31hn78dxRK0eHmgeW8qQRVoLXJ6kOBbkuK/3tFe7bgMMMYDr LapQ== X-Gm-Message-State: AOAM532e4TgFGlN8VUyjMfJ8hvFmP1xBj4Lo+1Xjr/ZbX4QPOkjy4Rwg iNVCmIJcc1WDmCGTuKMVvBfJUWWU1e/pl7z2IDonJg== X-Received: by 2002:ac2:4c05:: with SMTP id t5mr3290753lfq.89.1598782048574; Sun, 30 Aug 2020 03:07:28 -0700 (PDT) MIME-Version: 1.0 References: <20200829175704.GA10998@Kaladin> In-Reply-To: <20200829175704.GA10998@Kaladin> From: Linus Walleij Date: Sun, 30 Aug 2020 12:07:17 +0200 Message-ID: Subject: Re: [PATCH] clk: versatile: Add of_node_put() before return statement To: Sumera Priyadarsini Cc: Michael Turquette , Stephen Boyd , Julia Lawall , Linux ARM , linux-clk , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 29, 2020 at 7:57 PM Sumera Priyadarsini wrote: > Every iteration of for_each_available_child_of_node() decrements > the reference count of the previous node, however when control is > transferred from the middle of the loop, as in the case of a return > or break or goto, there is no decrement thus ultimately resulting in > a memory leak. > > Fix a potential memory leak in clk-impd1.c by inserting > of_node_put() before a return statement. > > Issue found with Coccinelle. > > Signed-off-by: Sumera Priyadarsini Reviewed-by: Linus Walleij Yours, Linus Walleij