From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2021EC3A59B for ; Wed, 21 Aug 2019 10:05:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DC7F020679 for ; Wed, 21 Aug 2019 10:05:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="p6cokKjo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726478AbfHUKFN (ORCPT ); Wed, 21 Aug 2019 06:05:13 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:37790 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726386AbfHUKFN (ORCPT ); Wed, 21 Aug 2019 06:05:13 -0400 Received: by mail-lf1-f68.google.com with SMTP id c9so1356511lfh.4 for ; Wed, 21 Aug 2019 03:05:12 -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=m1f2HiISSaidRsiBte5wZoNhW3uuVsn+JOSHikJRLKM=; b=p6cokKjopghFW0uPUX4eglH6ytwAHYRurXCzgZZIt1aZPpSL/CcrWzI/EjzZ8gr9d7 Jt/ily/6v0u1JXheWsQ2YpIYwiw7LAPiRusN0e1BC63/K0911V8HL3C4i8hJ7weQD2E4 bY2s+VAbDKhFunCj8/qf2vxrSYpBp4hBX5Oifu8S20n06e7CHjj13SiUNf0Wx6gRsRcq dxo10MAKRJwgCKxBLDBTLN1DEI4J5g/FcI/unRLd4Gj8Wm2Azdk3dgXDH1f0qaGrZjeh 7wrTIRSKLJIU2cXxrCgky5PHkzomRnf388IvVSGAsFXQJ2hGwLE1qUF7IiwRAfGPPs7r 6u5A== 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=m1f2HiISSaidRsiBte5wZoNhW3uuVsn+JOSHikJRLKM=; b=gSOdGWrU2+yHCjjJAaGqb0uEB+Q1tyDxf1lD/WPoqao3waEnxkiupNb/MEpfuNJvv2 pU1VSlCBH54nis5J4PAf53JIXyBTsEQD8u39Hvx/X1x6cyXStKEDT41BVbZfmG80Ip7A 0yNZ5l2QEUTzxMA9onsvDopn3U+ttzk8r5FdFg5+jiZStHYGViyU+5geTz+gPoldmL25 1FnbgZ+jG2QgtgqrWjNNr/9axtgyusHQ6abNUnXsdS2nlLGjP4/qnRI45K2NpSCmy63t 10yzsysfqbXU1BZ9fzNbXr35Db0agdOxgTuyWkpYC0cB4jlUHK+ky3NaMmvixZw+UT1P CkfQ== X-Gm-Message-State: APjAAAW9KmuuaxqKo94KjIYHUvantC0hiBv0fQyOeseFsrzrklaqmpf4 okArqijJEInX9A3JD8rApTDZ7M3erFryo2YGrdWHWA== X-Google-Smtp-Source: APXvYqzlFpwgtUN1/ODTvZFOvLQ4eLRvTCMKs2bpqwwkwySlDtut76JVRBYwgvUd9xNe5dwZoPTCvPOuggx1q9LsPn4= X-Received: by 2002:a19:e006:: with SMTP id x6mr17408408lfg.165.1566381911384; Wed, 21 Aug 2019 03:05:11 -0700 (PDT) MIME-Version: 1.0 References: <20190815060609.3056-1-nishkadg.linux@gmail.com> In-Reply-To: <20190815060609.3056-1-nishkadg.linux@gmail.com> From: Linus Walleij Date: Wed, 21 Aug 2019 12:04:59 +0200 Message-ID: Subject: Re: [PATCH] pinctrl: st: Add of_node_put() before return To: Nishka Dasgupta Cc: Patrice CHOTARD , Linux ARM , "open list:GPIO SUBSYSTEM" Content-Type: text/plain; charset="UTF-8" Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Thu, Aug 15, 2019 at 8:06 AM Nishka Dasgupta wrote: > Each iteration of for_each_child_of_node puts the previous node, but in > the case of a return from the middle of the loop, there is no put, thus > causing a memory leak. Hence add an of_node_put before the return in > three places. > Issue found with Coccinelle. > > Signed-off-by: Nishka Dasgupta Patch applied. Yours, Linus Walleij From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A05A6C3A59B for ; Wed, 21 Aug 2019 10:05:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6E9BC20679 for ; Wed, 21 Aug 2019 10:05:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bUPFjXau"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="p6cokKjo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6E9BC20679 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0tXJizOoYWfgeXO6nr5T4FzKJFwUyTNHYwBDwN5hQjs=; b=bUPFjXauJ6+AvE C0TS/MKa0kuu4wNEnJERf1Q37rVjGZUutfkljLZwazHxJgNz3rTBzajwNh5wgQHkAuF473qFX3nW5 nsV8uuJVAJ0JIuds48q6S4/qRgrHCt9YGPOKMTMaQ+SA2YsdN27fkoMvIGfdAqGXJZ2yNRyvpAQKS uo79OiXXApZQroN5COZlaB1b78+mPifoLdnZSSw+G+KSrpLVCox1ispoZe/LgCXK9obp/rhm1BC9Z S21NHSefYV82Wk/qCn0MdPiBPO9+3fRULqAgKQ7lWqN73XZRn0N7rbUxsk4SpygYhsgpntSeXNifo invFJdfSR+Di8UNrWUTQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i0NUT-0006NO-51; Wed, 21 Aug 2019 10:05:17 +0000 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i0NUP-0006N3-19 for linux-arm-kernel@lists.infradead.org; Wed, 21 Aug 2019 10:05:14 +0000 Received: by mail-lf1-x141.google.com with SMTP id s19so1338539lfb.9 for ; Wed, 21 Aug 2019 03:05:12 -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=m1f2HiISSaidRsiBte5wZoNhW3uuVsn+JOSHikJRLKM=; b=p6cokKjopghFW0uPUX4eglH6ytwAHYRurXCzgZZIt1aZPpSL/CcrWzI/EjzZ8gr9d7 Jt/ily/6v0u1JXheWsQ2YpIYwiw7LAPiRusN0e1BC63/K0911V8HL3C4i8hJ7weQD2E4 bY2s+VAbDKhFunCj8/qf2vxrSYpBp4hBX5Oifu8S20n06e7CHjj13SiUNf0Wx6gRsRcq dxo10MAKRJwgCKxBLDBTLN1DEI4J5g/FcI/unRLd4Gj8Wm2Azdk3dgXDH1f0qaGrZjeh 7wrTIRSKLJIU2cXxrCgky5PHkzomRnf388IvVSGAsFXQJ2hGwLE1qUF7IiwRAfGPPs7r 6u5A== 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=m1f2HiISSaidRsiBte5wZoNhW3uuVsn+JOSHikJRLKM=; b=PiP5QZAZbpXQV72sAVLJoZFLergFnscPzlklNxhN9xOJD0Cndqq00i3q3CfRKcRTpz fsVdHcrGU9+gpqctrpCOmYXxuoGm1ekleMzdLaQ6C/t+i57DbRQJy6ZvP2Z3NCBL9PuB CWM+PnONg8OqJFZAkzCWk8fIoWANv3kO8x924AVhr/exZ+gH8a1WJJmFvby9OQfYbWpi Ap8hhyk31RqZMdcySeGU10HDU3bK/m1dZp3DOBn4BRgNkXJ8dTZffxwasdaWVymHmwu4 lNRdA/9NpDi6QmnTc+k7MWUBqVCmpVMJmgBlJ3G8aQhf5P5Wsyor+ShWtCDHzhlNLwUZ j4ow== X-Gm-Message-State: APjAAAVffmI9d8OpBB8/KKA1CvKV7RSOm/3R9ygdpDU7OxGMDWpBS2Td S4QiE5vGDajowb7PV22USM9rhcoJPS+yYq3pxMTYsQ== X-Google-Smtp-Source: APXvYqzlFpwgtUN1/ODTvZFOvLQ4eLRvTCMKs2bpqwwkwySlDtut76JVRBYwgvUd9xNe5dwZoPTCvPOuggx1q9LsPn4= X-Received: by 2002:a19:e006:: with SMTP id x6mr17408408lfg.165.1566381911384; Wed, 21 Aug 2019 03:05:11 -0700 (PDT) MIME-Version: 1.0 References: <20190815060609.3056-1-nishkadg.linux@gmail.com> In-Reply-To: <20190815060609.3056-1-nishkadg.linux@gmail.com> From: Linus Walleij Date: Wed, 21 Aug 2019 12:04:59 +0200 Message-ID: Subject: Re: [PATCH] pinctrl: st: Add of_node_put() before return To: Nishka Dasgupta X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190821_030513_081793_3B42E35C X-CRM114-Status: UNSURE ( 8.65 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:GPIO SUBSYSTEM" , Patrice CHOTARD , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Aug 15, 2019 at 8:06 AM Nishka Dasgupta wrote: > Each iteration of for_each_child_of_node puts the previous node, but in > the case of a return from the middle of the loop, there is no put, thus > causing a memory leak. Hence add an of_node_put before the return in > three places. > Issue found with Coccinelle. > > Signed-off-by: Nishka Dasgupta Patch applied. Yours, Linus Walleij _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel