From patchwork Thu Jun 16 14:27:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liang He X-Patchwork-Id: 12883951 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 797BBC43334 for ; Thu, 16 Jun 2022 14:29:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233481AbiFPO3Y (ORCPT ); Thu, 16 Jun 2022 10:29:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235576AbiFPO2U (ORCPT ); Thu, 16 Jun 2022 10:28:20 -0400 Received: from mail-m964.mail.126.com (mail-m964.mail.126.com [123.126.96.4]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 32D381EADA; Thu, 16 Jun 2022 07:28:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=grxoG P1qCd90Ip8zeEhh6lnYzFuerUuxZRaP9WItxIg=; b=g0gbRY9ijw1dbfpBnoQOX zG21PzqpZW7JTRFRa4nwrHP5OULLFbTrWl8sQaiOND+Zxi8oHGB+uQve+pfgTDHu 6iVl4B0aG+Ex24I8oTJhaWUhaSg3bYloRrJ7bNK/Flz/AueMaAkoN2NZc4Qgzceg kH52J5eSWJPMq6r2J2Qbkk= Received: from localhost.localdomain (unknown [124.16.139.61]) by smtp9 (Coremail) with SMTP id NeRpCgA3HJHtPatigpSUEw--.41066S2; Thu, 16 Jun 2022 22:27:58 +0800 (CST) From: Liang He To: tsbogend@alpha.franken.de Cc: windhl@126.com, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] mips: mti-malta: Fix refcount leak in malta-time.c Date: Thu, 16 Jun 2022 22:27:56 +0800 Message-Id: <20220616142756.3987475-1-windhl@126.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CM-TRANSID: NeRpCgA3HJHtPatigpSUEw--.41066S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7XF1UKr1DJw1rWw48Wr48WFg_yoW3XrX_Gr nIy3WDtrWFq3WfZr9rur4fKF9rXw43Wrn7ZF9rtF17Kw1jvw4YgrWDJwnrGr17u3y5trWf C395ZF4xKFW3GjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUUasj5UUUUU== X-Originating-IP: [124.16.139.61] X-CM-SenderInfo: hzlqvxbo6rjloofrz/1tbi3A4iF1pEDu7zEwAAs5 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org In update_gic_frequency_dt(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Signed-off-by: Liang He --- arch/mips/mti-malta/malta-time.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/mips/mti-malta/malta-time.c b/arch/mips/mti-malta/malta-time.c index bbf1e38e1431..2cb708cdf01a 100644 --- a/arch/mips/mti-malta/malta-time.c +++ b/arch/mips/mti-malta/malta-time.c @@ -214,6 +214,8 @@ static void update_gic_frequency_dt(void) if (of_update_property(node, &gic_frequency_prop) < 0) pr_err("error updating gic frequency property\n"); + + of_node_put(node); } #endif