Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3057608pxp; Mon, 14 Mar 2022 09:57:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9mU+k+XI529PxfgYBQyt4oKMvzlXudLbbvw0zrg/KcueKtCV8kkv39LAnsZM9lqHxqS/8 X-Received: by 2002:a62:1a43:0:b0:4f6:ce73:d572 with SMTP id a64-20020a621a43000000b004f6ce73d572mr24866474pfa.69.1647277071638; Mon, 14 Mar 2022 09:57:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647277071; cv=none; d=google.com; s=arc-20160816; b=es4LE9kvk1niGpZurTd6ZEvs6OKG9VbxtSbJ8kFphEvU8N/FfSarnM6RXIsO/P2cd0 +HaNtQSIw/iBTr6eXrkpkCqUo+av+9TRGK2SaCIWKq9qQtz8bx9SD1NRvLTU9dJNonTk WyC9mRPcNhJKRq0R+/IcmF4ybJu2Lc9W9AZTUv9NgxOwJLewDdrB+/wJE0BKi3TX2qvT XjJC8iQ2l789G49f4wBNLXrc5E+tcJPsDZAmv7Ua7R0VEDr1T0HoOy+7qcmskQ+Ig4/F /lJoCum3ANNF6zkA6OFsbqbLNXjBFSwmPPG289HtUgOvvT2tBOKTt4t6uiQ+eCH+QjdP hIzQ== 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=mV7ZoLOIDG0E/0IT4CP63xNm4g3vfSYEpw7qDmiDUwQ=; b=0hbiSvYTRXVsL1179OyFUQfpHU5xBtYdiqxYAEr+e6adhpsyLOvkOExBk4gpIHOdPB ppre0hwftn6+MuPmqK9ipmVJjHdyiygeg1+GFA47Y3BjvBH8yNVFNmRbTKgue4xBBH2n Aouq2ADt5fzcRdGwPP4gHG6xznC+Skw9bPBqcUReiL/YXf2NPHA3CfJWqnJgAtKqyyRa hN7XglIjPJNhdijUv+5JW++j6hN9C9nalcLODgKi9dPvsSRrFqGqa9/AzyQt6YpGbwqN 4L7qaGGwCiVySMAEk5kCdaZKTSLl2QIJlOzUMELaVUABR306V0navImarB0h78qxeZTT 11fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="l6R/OGQY"; 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 v191-20020a6389c8000000b0037c94d14cecsi14784658pgd.96.2022.03.14.09.57.37; Mon, 14 Mar 2022 09:57:51 -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="l6R/OGQY"; 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 S241734AbiCNMZt (ORCPT + 99 others); Mon, 14 Mar 2022 08:25:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242538AbiCNMTI (ORCPT ); Mon, 14 Mar 2022 08:19:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAF134F475; Mon, 14 Mar 2022 05:14:20 -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 ams.source.kernel.org (Postfix) with ESMTPS id 9920CB80DF9; Mon, 14 Mar 2022 12:14:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9525C340ED; Mon, 14 Mar 2022 12:14:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647260057; bh=m8jRNaz/jrCc7HEoFVxnZs1a2N3/lU3a7CW7j0amyek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l6R/OGQYu/cZ8nnPElkE7Kp5KzKNXJ5qcozwrJejaTfa+yfxCkgrE9MbrEwqkeoov WVuLNFSdAI+HMNCJv65ScIqNp1kKvIxy9/yJbbMroIXkPFNRUep+XZIHs6iFimff2X haUl0R6jj+cilX9B5XyMsSCLhqQUqSGx6VcLZAtA= 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.16 043/121] net: marvell: prestera: Add missing of_node_put() in prestera_switch_set_base_mac_addr Date: Mon, 14 Mar 2022 12:53:46 +0100 Message-Id: <20220314112745.329830316@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112744.120491875@linuxfoundation.org> References: <20220314112744.120491875@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 c687dc9aa973..36c5b1eba30d 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_main.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_main.c @@ -553,6 +553,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