From patchwork Sun Aug 4 16:34:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishka Dasgupta X-Patchwork-Id: 11074811 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7CF3314DB for ; Sun, 4 Aug 2019 16:35:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 672412878E for ; Sun, 4 Aug 2019 16:35:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55FCB287A5; Sun, 4 Aug 2019 16:35:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0E3212878E for ; Sun, 4 Aug 2019 16:35:02 +0000 (UTC) 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:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=pV58AGuRmwl3Di6cP5gRokbzY6BS96lrIgfdghiPAFw=; b=ZoZyg5Kf49Xq0O oKm95QMHwy/9pglH07xtx5iM8K0fgQ7vgZ9Tlw4WLivUg1Vkhv/cpmGPglezTxQyME6Jr22/j88Ay UL/e7dJmBuLft/1lncTGBuQqcAmlqtWf2lXbIbCoXT2fDhZx4fkmMgJ+gzBr2+OSRWNbO0/8tSqE6 PiSra0mnsbLLfaRHmTjoZHOVida1Nm+xOIJkp7weCUnsE5JRHvybVOBWIWIJWT7nFktQr/oqZDMpv f1ju/O3s5GtHRp2rkCUYdSoB27CfvGuEOx/B3I3oDUX9bo8d1WoQi12JEOjIrio82M47/YI2q1XBz zQvb4/JudU44S9wot6xg==; 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 1huJTI-0008Ku-Mu; Sun, 04 Aug 2019 16:35:00 +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 1huJTF-0008Ka-QP for linux-arm-kernel@lists.infradead.org; Sun, 04 Aug 2019 16:34:59 +0000 Received: by mail-pg1-x541.google.com with SMTP id i18so38430582pgl.11 for ; Sun, 04 Aug 2019 09:34:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RMNZF6KtAhN+Gy6BEZNu5CSdVLgGJb/v0I5vpK538AU=; b=lyTErawfTJoMJqfE8HkSCDA8rN+sB6eXWpSvvbRnPRj4XddswSwG4eKflR5VgJg9wE X5oYDehddYJjdMzDimNru2HH6v/2H/LJfFJEAihVoshqwClSNoCUT9u7XaFdhoEicsAK +iRyzP7KXmcHgNymdH23UH4fczWS0DnImq5SntepN4LL9SF5NP1jooO/GYoHNFyvltTN Elg76GRtO0ej16csnkWcqnW+ss68TE2JXz3k+yf+jF9wYhkpX5AP214GMb+tGAYvQ2Zz 6osUFy5sgJKLp0jw218rjeyxq8Xq+j6xgf/AefiYfq/ISNGh3+pmR5GoN8+MlUgvAYtJ bLKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RMNZF6KtAhN+Gy6BEZNu5CSdVLgGJb/v0I5vpK538AU=; b=qPOO3JCkz/DHSi8F0pTA49uLSgIOwoRnWS8aaJGpbWg15cXihT/goXqcBYoyg0Q2Cf pIFvuY3QQdWOqYxJYKachwRltgWOk0Fp5oaNc1o8nPOwL6pHiQfWkw/tdEchqq72hYwU uvzAJ6IJCx73QukS47dUj7ZJWI0ypP4IEvXVx7xDEG/ULRkPu95hTRoh8L0Jya2Rc3n3 BbzLFI6BnxQg4J8dG1ivZEh5uOR5QR7+mDrzhLW/WqaC627/Y5qaxB4gkLgUwDXTYb/V WSfXNEtTF+4qLfi6eUZQU3uvS+SLIWzkylCkiHAix3cIF83OF97h8UerK/Pl4wbXx6Dx O1tQ== X-Gm-Message-State: APjAAAWAdFyark8RaOuit59+CM+wWfuNn5iGAZct3zeSP3MZbgWY+uZY GLhYpd5Vc7PJL/l72bjsZPQ= X-Google-Smtp-Source: APXvYqwPoWuNw9I9Cs1c3kM0bkcz2Tck+syFhD3GywXmw+F40iMATsaw5FfLo6ot9vLlER45vbQhhw== X-Received: by 2002:a63:c118:: with SMTP id w24mr131695706pgf.347.1564936497094; Sun, 04 Aug 2019 09:34:57 -0700 (PDT) Received: from localhost.localdomain ([122.163.105.8]) by smtp.gmail.com with ESMTPSA id i124sm148519507pfe.61.2019.08.04.09.34.54 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 09:34:56 -0700 (PDT) From: Nishka Dasgupta To: mturquette@baylibre.com, sboyd@kernel.org, linux-clk@vger.kernel.org, linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] clk: versatile: Add of_node_put() in cm_osc_setup() Date: Sun, 4 Aug 2019 22:04:44 +0530 Message-Id: <20190804163445.6862-1-nishkadg.linux@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190804_093457_884462_667DB61D X-CRM114-Status: GOOD ( 10.42 ) 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: Nishka Dasgupta Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP In function cm_osc_setup, variable parent takes the value returned by of_get_parent, which gets a node but does not put it. If parent is not put before it goes out of scope, it may cause a memory leak. Hence put parent before the function terminates. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta Reviewed-by: Linus Walleij --- drivers/clk/versatile/clk-versatile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/versatile/clk-versatile.c b/drivers/clk/versatile/clk-versatile.c index 90bb0b041b7a..fd54d5c0251c 100644 --- a/drivers/clk/versatile/clk-versatile.c +++ b/drivers/clk/versatile/clk-versatile.c @@ -70,6 +70,7 @@ static void __init cm_osc_setup(struct device_node *np, return; } cm_base = of_iomap(parent, 0); + of_node_put(parent); if (!cm_base) { pr_err("could not remap core module base\n"); return;