Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3920355pxj; Mon, 21 Jun 2021 09:23:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyO4Oh3mKgKHi+GuVZinr+m/H3/1eBvtsxxGtOH4pO5TkgRehToOsxKcE/MUa+qoSOqooyE X-Received: by 2002:a05:6402:34d2:: with SMTP id w18mr22395000edc.292.1624292611779; Mon, 21 Jun 2021 09:23:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624292611; cv=none; d=google.com; s=arc-20160816; b=O0ijdqIJjqMYZ2eyyzeisHnYieHejfP3J5fXHoiqj5+xWAHaCPkYqPHLJKPOsd+jFp 9aQuTolbZbMYfONTl8zDG/4oAbszd3f5Zfu0/jiDamMY3igfmUzWJi2+FJq4KfH3dQIK VhxJe/RENn9ccMYsfIS2Fd0r5NaUvJcPvyFxMd0Bp8aDPjn5/BuLXFYwQaIaSYjGDLpC 2im5heuhuhfEEyupz7nqaTpKdjv4SVKMKIA9G5mADDLYFfsUpBXoJL09dnRsEIuiGvLW c7ghdHCeQdq9kXy4ROgKP1exzUtqmQLKlF0n1IKlEW/MWX767Sn/JXDWW4XPDdY7NruA xQ2A== 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=58Oc0jRivO0Zi2ntC3htLWK4n3QR5eT4jKKdNWwhPO0=; b=fRXB3VV1RZeHsPpMNhRf3Ms5iVPnqBuWf/Tg6AFVWXCH0Qm/T1Lt9EOr45z+ydK0hy LaFWKwUIz3zII298zeWg7QA01Fik7Qr0VVviFHJ5sFsmWzilE4t9/AtxpAk8uxndh6sV JfTPdTWPTtrVGLWRp8zTbhBR9kYfLU3az0LEISBnTY8vD/7o9/0nmViKRI5GAbF3YwHY onGZLk3Xm5c2GWVSrb86+ZOGrkUH66G9sGjY4hZJ/Ibh33yCEuKTTB7xqmRiZ2Uqw0up fr5b8rciULeFXQ1kH2UFoYuUYUDj+uA1fzPpJ7IfGjdNb+iX94UtgZkBO5We05xxQPua XfIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=B3djjWsH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 11si10814585ejn.267.2021.06.21.09.23.08; Mon, 21 Jun 2021 09:23:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=B3djjWsH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231856AbhFUQXw (ORCPT + 99 others); Mon, 21 Jun 2021 12:23:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:42214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231877AbhFUQWR (ORCPT ); Mon, 21 Jun 2021 12:22:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 965B56128A; Mon, 21 Jun 2021 16:19:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292393; bh=c45O5PKH4jcr3/1H1tThPHvnWp+9hIxnRtSWZwGxvHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B3djjWsHNIcpm7M2xN/dIpuCcd+uQCLnEkgN9FEpinXxgAQB9d/5T6yCdOckGq5S1 +MBHxcL4cNXjgzoIRlFq5MZbPs8p7VD40vZh0OxkWO3T4lNxruILSJYoReGKPAz9B0 E9hFTrFT3ytv1CYNCyzIuQN041kCkW3ssJxopEEg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Somnath Kotur , Michael Chan , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 40/90] bnxt_en: Call bnxt_ethtool_free() in bnxt_init_one() error path Date: Mon, 21 Jun 2021 18:15:15 +0200 Message-Id: <20210621154905.477927069@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154904.159672728@linuxfoundation.org> References: <20210621154904.159672728@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Somnath Kotur [ Upstream commit 03400aaa69f916a376e11526cf591901a96a3a5c ] bnxt_ethtool_init() may have allocated some memory and we need to call bnxt_ethtool_free() to properly unwind if bnxt_init_one() fails. Fixes: 7c3809181468 ("bnxt_en: Refactor bnxt_init_one() and turn on TPA support on 57500 chips.") Signed-off-by: Somnath Kotur Signed-off-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index f983d03da1e4..d1c3939b0307 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -11963,6 +11963,7 @@ init_err_cleanup: init_err_pci_clean: bnxt_free_hwrm_short_cmd_req(bp); bnxt_free_hwrm_resources(bp); + bnxt_ethtool_free(bp); kfree(bp->fw_health); bp->fw_health = NULL; bnxt_cleanup_pci(bp); -- 2.30.2