Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp871980pxk; Sat, 12 Sep 2020 03:11:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzCcS8lwIJvFHikc3nkw4rBm32GGu+DSVzz4ps8x1fYWjuvAoBbsl7E74fGzv/EOYRYmpv X-Received: by 2002:a05:6402:1a48:: with SMTP id bf8mr7358019edb.298.1599905513673; Sat, 12 Sep 2020 03:11:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599905513; cv=none; d=google.com; s=arc-20160816; b=MVCKsdBIlLajKeY+YF/64aG5JqBvXW7POn/jsIg+5w8v5qHQU8Oa8cXQP+qr6nKHoK +0vvHq5OEIVRI9EF8jf2PZrfyQaMNAxG3arzplRSCb5/MhXjq7TiPlpqBNDKomm9MLvl wAiXPyrDaodirdHj7orq4l9BwD0RWgb+UY1jyEKuJSgmJLe6k2ffSGQ9OK/kKqn56Qh2 bxswOcZnrlK6Da44v7hl4F5FORJ03XT26HGjyzV2xCz7M7PJJnaBK4+Duu4RW5hwnNXX 6K4mnNM4EECxupY6cQfHV9BjkESyyNeF53xuYgcxEjvAbq2EaP2uUzncdIurLFF+McT2 jXtg== 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=IDTYW3trvJhHdaQhRFqDVdIqzcok74e7pbHeU+yogTA=; b=WbV00Wgt/f5Gm1Lu7DhPsPFlKD76Ic03asrsbuFlUybwM1dTDiOsCY2k/tEX3BHp9j GpGwFaYPOyEv5dseRxm5RQz3tk10XM9h9QGa60UCr3aHWuMRX0UPE2ksN2wQqoGmuJwn hiGaW0aPM+/xabldjDokkp+TqlUFHx0UhGv4+bZYLgV4P1uy569URg09d4+gTx3DyHG5 /l2VYn/3DAO0PoDCxqJsdtKTZ2KX02gKfDplk/mcor3TMdSB5oO9sn3vR9816Sd4QsgM 9o2d/I2L8sypcMMBO0TJvPytT4d24Cl/GYfJYPiiRk3Lja3tuB/6SzFa/hb/O5m9RAjz /RmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a0OfaWjM; 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 mb19si2875418ejb.589.2020.09.12.03.11.30; Sat, 12 Sep 2020 03:11:53 -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=a0OfaWjM; 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 S1725836AbgILKKj (ORCPT + 99 others); Sat, 12 Sep 2020 06:10:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725813AbgILKKi (ORCPT ); Sat, 12 Sep 2020 06:10:38 -0400 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CC87C061573 for ; Sat, 12 Sep 2020 03:10:37 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id b12so8352030lfp.9 for ; Sat, 12 Sep 2020 03:10:37 -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=IDTYW3trvJhHdaQhRFqDVdIqzcok74e7pbHeU+yogTA=; b=a0OfaWjMNAUmatft5DHcMJCpcnT45zK5jdP/4JhxgcfIa0Y133kYVJ613Yl/XPRUIN vZgnToloBgjePkBogAawPrCQ3/Y0qlCDfrhdlSISvq+ywNzw0TxaEXT0iFYZNgcggtMS KztpalH8ZsyaUUrP5zZaLwfL6ocKKAfW6Oe8AICzITsn1njl42GKxufhCFB9ksSCJXTM Tyi44ZAQeY6A/3tPzbpB/EB8qn1TkKlMVe+C3luy1KVoA8OpY5fpRvk5FGW1CN0uJAO/ YCeXZDZSTzyXxPs+MzEK1n8Ep2iz0dJ2Fee9JZXmJDqdQrUwTE8H+IuimABpFQj2segi cRpQ== 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=IDTYW3trvJhHdaQhRFqDVdIqzcok74e7pbHeU+yogTA=; b=JgDX0AsWvMFk3azxBFWw2Gqk6MjT/tr2Zwt1ASqrnjrqND+Y2/7sFNhNn82XP63ek+ cGXj9vYr4zPIa3aVTmsw4nFU+Uogu/OtGytWR89ZhnUtAca0Cemi6Evbp3cbVA0oMEbs 6XvVEfnTyeBoSvaqujyQYrY0AiS3ZVwq4qn+eqV/8rxfwbq6IFmZijW7BR2egnytU/CX 2UQO/fmhdD4RAZ+0eYLV3hJyk9ZVlxqVx/vJ8HqBq/8YTYRQSdckFiqTWCrBmK2HlqpU 2XMQ8JJSysTxqtrazEufPxX3VnBlbtbyxHlNYyKhU8nOvJufoVxSOKRBriqYn94yj2vU AmVQ== X-Gm-Message-State: AOAM532W2AittXH12HXPEbzCAnI/jkzWi4asH4ksAYdvsQhjhLZcls9M KgU2+Ln+EtKB8CKGryqVs61mb3FCMJIgpIcZ5OGoaA== X-Received: by 2002:a19:6c2:: with SMTP id 185mr1451633lfg.441.1599905435954; Sat, 12 Sep 2020 03:10:35 -0700 (PDT) MIME-Version: 1.0 References: <20200829174154.GA9319@Kaladin> In-Reply-To: <20200829174154.GA9319@Kaladin> From: Linus Walleij Date: Sat, 12 Sep 2020 12:10:25 +0200 Message-ID: Subject: Re: [PATCH] bus: arm-integrator-lm: Add of_node_put() before return statement To: Sumera Priyadarsini Cc: Julia Lawall , Linux ARM , "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:42 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 arm-integrator-lm.c by inserting > of_node_put() before a return statement. > > Issue found with Coccinelle. > > Signed-off-by: Sumera Priyadarsini Patch applied. Yours, Linus Walleij