From patchwork Mon Dec 5 07:40:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Yufen X-Patchwork-Id: 1712156 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=aG4WFfgz; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NQb8B0rBMz23p1 for ; Mon, 5 Dec 2022 18:41:13 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :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=4Z/fOzT8ZetAJ2OrwA42qORIk0Z7484QapVAwrqQzq4=; b=aG4WFfgzIKr0mF xZPhrZi/+4bGjoPgCEyVfuzqQJ5wT60bgWXass14uVbhbyVuErh9ToYogY8Ox/T7/jrOy1kUjptbX xqmm9+Uypa+evipuKuZwJYX9zVqIlsoAH9z1w/p1Wzoe4sjRaIlGZapg4Pvgg64Re0h3DdM8Zx7Ux v1zNgqwyvvWeitMuoWnZgTxpKkqxxb0yena8t1ONagonntApD/ujHwiPOpH9+QQufquU8eXc02h+M WWqAaZo0FpnyscM+t+wPC/yM4pftM2vdx0LwtToFWWE+wYG7OsNB27z8b/bv0b/S6CDbMuxWunSea nUgbXCO40qCF0M+EYJ7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p265y-00FiEz-D8; Mon, 05 Dec 2022 07:40:58 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p265u-00FiCw-Ko for linux-arm-kernel@lists.infradead.org; Mon, 05 Dec 2022 07:40:56 +0000 Received: from canpemm500010.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NQb2w75ZWzqSsg; Mon, 5 Dec 2022 15:36:40 +0800 (CST) Received: from localhost.localdomain (10.175.112.70) by canpemm500010.china.huawei.com (7.192.105.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 5 Dec 2022 15:40:48 +0800 From: Wang Yufen To: , , , , , CC: , , Wang Yufen Subject: [PATCH] ARM: mxs: fix missing of_node_put() in update_fec_mac_prop() Date: Mon, 5 Dec 2022 15:40:11 +0800 Message-ID: <1670226011-11140-1-git-send-email-wangyufen@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.175.112.70] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500010.china.huawei.com (7.192.105.118) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221204_234054_865862_109BCB5B X-CRM114-Status: GOOD ( 10.27 ) X-Spam-Score: -2.3 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The device_node pointer returned by of_find_compatible_node() with refcount incremented, when finish using it, the refcount need be decreased. Fixes: 5653acc24c13 ("ARM: mxs: store mac address read from OTP in device tree") Signed-off-by: Wang Yufen --- arch/arm/mach-mxs/mach-mxs.c | 8 ++++++-- 1 file changed, 6 insert [...] Content analysis details: (-2.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [45.249.212.187 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org The device_node pointer returned by of_find_compatible_node() with refcount incremented, when finish using it, the refcount need be decreased. Fixes: 5653acc24c13 ("ARM: mxs: store mac address read from OTP in device tree") Signed-off-by: Wang Yufen --- arch/arm/mach-mxs/mach-mxs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c index 1c57ac4..5e11580 100644 --- a/arch/arm/mach-mxs/mach-mxs.c +++ b/arch/arm/mach-mxs/mach-mxs.c @@ -180,14 +180,14 @@ static void __init update_fec_mac_prop(enum mac_oui oui) newmac = kzalloc(sizeof(*newmac) + 6, GFP_KERNEL); if (!newmac) - return; + goto out; newmac->value = newmac + 1; newmac->length = 6; newmac->name = kstrdup("local-mac-address", GFP_KERNEL); if (!newmac->name) { kfree(newmac); - return; + goto out; } /* @@ -229,6 +229,10 @@ static void __init update_fec_mac_prop(enum mac_oui oui) of_update_property(np, newmac); } + +out: + of_node_put(np); + return; } static inline void enable_clk_enet_out(void)