Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3034213pxp; Mon, 14 Mar 2022 09:30:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxztvHzt8GTRyiIhLwj4WuuPTdTTi+nEJGNv7r2DabKAZjWRZrPgVtbJgMsYKXL2SFemhZ1 X-Received: by 2002:a17:903:2448:b0:151:8173:abf5 with SMTP id l8-20020a170903244800b001518173abf5mr24034375pls.55.1647275448685; Mon, 14 Mar 2022 09:30:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647275448; cv=none; d=google.com; s=arc-20160816; b=oQhpcA7auqOQF+FxTBJjGCSX6oB8LB3gnQEiJ8mBeHhcrtoWv4GneDUiI1/087MZkx m3U0kSdLf02UfT4QN6DScWOwQTTEsKtAAEppXWInOpsPZPgiAixZZyUG7CP10YOSjZcY psjaNm/rwey2ODF6iidj37xHfOPpvyR3fGPfQPrEt13KDA4xh74fM+I8vMuTpb5Sdie3 rq+e2b0z/TCHlnjtagIhyfbmx01hCbIx6cMgmadkqs7MpsfILdUaNQsrK1cCM5d1K3BS OGRUCNj6XUhLpCW1TchP5fsKoWQkj04a6wahRcZEdj25rm7QKAhg4hN4/3yfS6MT9qPK G14A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5j3JvBQxZFkDJv9aQt069ot3pJIaAqQNW2fp3cGMqoA=; b=1AHpozpr4IrMcOS2CSGltZi3Lsh+4WCtLTg6g4XM8ll6NsjVDd5+3WPwIVgv4HlchC J5OL8GUgtQG7EHn2mIEwzIEpIkTLCAatAJRJcJPHMACblGNhl97NXZZY3c6U6Yroq/K2 t8j+Py+hleo1TJmHKsnzflgYKE5BDQhHYDGxUER7J+pp6JShCGKgmMGBpLU7IBqN/wxD DnOvv/9hZiO0yeiEaDcnWfElpiV0k0oiQn+3HWJS28eai5xb7rCB2EaQT8D+iTctMdjE T6HW9z224q8Vfuhmkv/HyKPDfmPd7eBYm6vLQ3TNUroFLwrD1Iklqn6maUPgd0QaFmAY 3/PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GQuZvWto; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k12-20020a170902ce0c00b0014d9b77957esi16126495plg.88.2022.03.14.09.30.34; Mon, 14 Mar 2022 09:30:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GQuZvWto; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240533AbiCNMLy (ORCPT + 99 others); Mon, 14 Mar 2022 08:11:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242599AbiCNMKT (ORCPT ); Mon, 14 Mar 2022 08:10:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F182286F4; Mon, 14 Mar 2022 05:09:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C7FB461343; Mon, 14 Mar 2022 12:09:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 281E4C340E9; Mon, 14 Mar 2022 12:09:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647259744; bh=ICvhCKwHKbHLMWGfifNq3QhX99AN9pHHdmficVHS+zk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GQuZvWto9E3dKdPpom+NidI7CJlKMO7yutPqYHAM8l6UkCUJ4NYQf0FtX5x/68dRZ feC6bQRIJFBhuo7d2Gk+sezJ7fkEh2wB46UqDr5eMhgz1/xYUTA+EMbidSr1DwIBaR 9I/twmKbA5uHySrs2P94tvDYBz2vnbOsfAZQexd8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , "David S. Miller" , Sasha Levin Subject: [PATCH 5.15 038/110] net: marvell: prestera: Add missing of_node_put() in prestera_switch_set_base_mac_addr Date: Mon, 14 Mar 2022 12:53:40 +0100 Message-Id: <20220314112744.101806199@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112743.029192918@linuxfoundation.org> References: <20220314112743.029192918@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miaoqian Lin [ Upstream commit c9ffa3e2bc451816ce0295e40063514fabf2bd36 ] This node pointer is returned by of_find_compatible_node() with refcount incremented. Calling of_node_put() to aovid the refcount leak. Fixes: 501ef3066c89 ("net: marvell: prestera: Add driver for Prestera family ASIC devices") Signed-off-by: Miaoqian Lin Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/marvell/prestera/prestera_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/marvell/prestera/prestera_main.c b/drivers/net/ethernet/marvell/prestera/prestera_main.c index aa543b29799e..656c68cfd7ec 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_main.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_main.c @@ -492,6 +492,7 @@ static int prestera_switch_set_base_mac_addr(struct prestera_switch *sw) dev_info(prestera_dev(sw), "using random base mac address\n"); } of_node_put(base_mac_np); + of_node_put(np); return prestera_hw_switch_mac_set(sw, sw->base_mac); } -- 2.34.1