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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 372E8C3A589 for ; Tue, 20 Aug 2019 21:55:27 +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 0AD8B22DD6 for ; Tue, 20 Aug 2019 21:55:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WHNJNqsk"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="oCBGLwep" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0AD8B22DD6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com 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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Boij+mWHOTjh4DUE58WFOXxJLTJaxgyEoz8Wc3rtiCs=; b=WHNJNqsk+ZgJh3 4JQhzwFbkGR8Ll4jSEnRec7e5OUGMW7JIWOV2/hhc8Dxol6BQIyh5R2SSbS/qO6xNa5Fjww9qUURH ycl23XA2nY0u2pj6UneSlXRqZAYXslnUzB9ynNXL7H09qdAOKc0YRZPWdzjv7jXF2WuuQJEcm8B96 DTwbmGRRhp2gYwh21uwim4qJ7tCaeZeBdA8XSY7DAX94fQdwG5RLSphze0k3HV2wq4EJTfsmG45nI cO3w7x861ufuPIyxT8st3lWxfTJ42QKCd3LypghJmEft5cPZIusVKHbnuN26KQVQZtAMguP9VRaTc o3Fne0oQK/Hsm6x2MWzw==; 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 1i0C64-0007Y2-Ul; Tue, 20 Aug 2019 21:55:20 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i0C61-0007XM-1Y for linux-arm-kernel@lists.infradead.org; Tue, 20 Aug 2019 21:55:18 +0000 Received: by mail-pg1-x541.google.com with SMTP id d1so73971pgp.4 for ; Tue, 20 Aug 2019 14:55:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=8VU1pHmXBevt3/YEG9ZrgZrwZThbu5eNyC/wqF7k5PY=; b=oCBGLwepBGVAKrTRjodfusyt/uXKIPk4Eti2L19Mr34lKF3lq3FC2ivBG++x6G3xcR 6dGjXas05CA7uBxliafQ1EE5aZ7QyctGbqCyconhuu2ttfzL4Dgpz7sPOVIhsx1j+kYA DzPyffKCCufumwhNm5gxoN4qKPYIo/Lr2KQIXKoZmOR7VYDwGOhXrVMHNAibAoZbvVmL 5823zw0BUKZO2BOqPyz+Inhiigzqpc879qrVltX90vfETeZpFu7NXCsltF+Iwdx3H7H1 6kysoFBvZ+FZZJaww/TznF3QOdjYqc+kRBgD1PpglA3xhtUr0ZRssLlJx44CN+bNk8Y4 UjSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=8VU1pHmXBevt3/YEG9ZrgZrwZThbu5eNyC/wqF7k5PY=; b=puQ9cAM9BqffTjyXq8tFOYB+WLltcQHQFhLRwJiovq6haJQZzS4XY/HDfznwbE1UD+ hqrLN7ZtQYEVjj+Idv+eH+A/SC0IwfLeh4u1KRz+LVT8IRkWNWu9AbrOBattauInAFru C0pgRQWe2pAmvFMsFN2IcWA4u9uHwxToYLt4xPZqzkidPAkUJKMuzf2LDsE+5hYV8LE7 zdLhFb0Z5R+4JO0scXlHPnOcns2m+iRtR+mbCpPYaUkLAPT3ofcXfcQoWGuUHpj2Anxu bN6A/d47dvKP8bH+htqQs/LzzDdMjZkEGtTpZ+W2SDp41xGS44lNX7Y9eYoLYjIW7c1s kZoA== X-Gm-Message-State: APjAAAXU3q9aJoxT3z06qlcpiP1H6NdpsOcMpmze5I7ivtw+SmixSwNg 8KCzfyz5nxNLH0St9A7OZ+8wbA== X-Google-Smtp-Source: APXvYqxytPtQ5YqOUnI1C63fu9JCZ/udi8nroU0IjFcXGWsLQft64HS9+cBSGO5Hh26fbBpADPbnvA== X-Received: by 2002:a63:6f81:: with SMTP id k123mr27148015pgc.12.1566338115500; Tue, 20 Aug 2019 14:55:15 -0700 (PDT) Received: from localhost (c-71-197-186-152.hsd1.wa.comcast.net. [71.197.186.152]) by smtp.gmail.com with ESMTPSA id e24sm22844749pgk.21.2019.08.20.14.55.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Aug 2019 14:55:14 -0700 (PDT) From: Kevin Hilman To: Neil Armstrong , Nishka Dasgupta , linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org Subject: Re: [PATCH] soc: amlogic: meson-gx-socinfo: Add of_node_put() before return In-Reply-To: References: <20190819072706.31732-1-nishkadg.linux@gmail.com> Date: Tue, 20 Aug 2019 14:55:14 -0700 Message-ID: <7hh86bcxj1.fsf@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190820_145517_225691_454D249F X-CRM114-Status: GOOD ( 13.63 ) 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: , 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 Neil Armstrong writes: > On 19/08/2019 09:27, Nishka Dasgupta wrote: >> The variable np in function meson_gx_socinfo_init takes the return value >> of of_find_compatible_node, which gets a node but does not put it. If >> this node is not put it may cause a memory leak. Hence put np after its >> usefulness has been exhausted. >> Issue found with Coccinelle. >> >> Signed-off-by: Nishka Dasgupta >> --- >> drivers/soc/amlogic/meson-gx-socinfo.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/soc/amlogic/meson-gx-socinfo.c b/drivers/soc/amlogic/meson-gx-socinfo.c >> index bca34954518e..13695a72c695 100644 >> --- a/drivers/soc/amlogic/meson-gx-socinfo.c >> +++ b/drivers/soc/amlogic/meson-gx-socinfo.c >> @@ -138,8 +138,10 @@ static int __init meson_gx_socinfo_init(void) >> } >> >> /* check if chip-id is available */ >> - if (!of_property_read_bool(np, "amlogic,has-chip-id")) >> + if (!of_property_read_bool(np, "amlogic,has-chip-id")) { >> + of_node_put(np); >> return -ENODEV; >> + } >> >> /* node should be a syscon */ >> regmap = syscon_node_to_regmap(np); >> > > Thanks ! > > Reviewed-by: Neil Armstrong > > Would need : > Fixes: a9daaba2965e ("soc: Add Amlogic SoC Information driver") Thanks. Queued for v5.4 with Neil's tag and the Fixes tag. Kevin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel