Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3299905ybb; Tue, 31 Mar 2020 02:24:27 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvtqCfCp3rhOiWvDO6LHNM9gZIwvwelryR9sgNZIM4Sva1Vw6OBwmjZUduNelr8TgM304SA X-Received: by 2002:a05:6830:1054:: with SMTP id b20mr12157458otp.360.1585646667069; Tue, 31 Mar 2020 02:24:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585646667; cv=none; d=google.com; s=arc-20160816; b=cSTD9iN8iqODtADjoXd97e0vMOTgil9XlsZSOYlwhWTIUH5FZLEhpwQoVOS9BgdcUG D68UUYtXAuGPwZ/x/uun41LmYpWIYuU/E+OXKPkYBfAyXRG6UlnsFc8EHOaVX3gNf1Na oUHrczovo9Vv1tjdVwmrMcuixTODK4V/5jbzs0aem0gHCgVZrRnZsYZ81MuiBTj7Vnk/ HgkJoZU/RO9PR8Fqv55zl+uyFHekck/00SNJv/013bIGMbx3AOAZfu3jL2WAnPsesu+E TijxNxmezgOmlXdDdSls7993/oJIbNcY9YF/w6WGjlW2AIwceNXg+r1p1ymAo+3j6UA7 /YXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=C9MWn7YiikP+AHjxDzLtzgKZbRhAjPWkrOe/52C4/z4=; b=EDwNF91dTjG6Pz833DNnqkA4cQinpdU0QvYL0rvSC3ofAYzxr0uoVW9gidkmxlko0m ieOOFAWJyTHs9eBn/mvYUTJGej0m8FFuZzMn17x6QThVQ/6PDp0sukoR3nBYaHXoM3Dq ZO1t6YhtGNGiQfDDz4mx/W+ac28zAYOc4X7EonN+xslTsRfUr5oPwBlXevtLMZpyDK1g ykf/4FgG2Dpc/gUYaDPjhqSv/xQ3bdbxqNEWpUfO/lPP+baoB8hM9ciGV3VHAZSe9JU1 KyZRFauNeEGAHIoTB4wqLbl9Nv0xXbUcs+kLNgfWTe0Z0Bi3k/CBgW14dMadL5qaBG5T V0mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AdDA6UlW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m125si6387977oia.240.2020.03.31.02.24.14; Tue, 31 Mar 2020 02:24:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AdDA6UlW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730835AbgCaJDc (ORCPT + 99 others); Tue, 31 Mar 2020 05:03:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:43238 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730603AbgCaJDa (ORCPT ); Tue, 31 Mar 2020 05:03:30 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 77AA9208E0; Tue, 31 Mar 2020 09:03:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645409; bh=2vGgD4H5dto+NnkoP/8GmGv6oQW+1nr5MOXHsQ/uGgQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AdDA6UlWn96wI5SYsP9CCq9SD8DUN2g4kuSDB8DS61xxKm3tibNHX04LNPR01S/cY /Up5PuYbjw2HM4X8CR6AZ+93xu5MD/FaYboCm3KHRhmqshT3yTZcFt7n3UZ6qAqXTn rvnKsX8bqSDUv4ORaXW4t03cDgwNFzZurL5r1+3Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Chan , "David S. Miller" Subject: [PATCH 5.5 045/170] bnxt_en: Free context memory after disabling PCI in probe error path. Date: Tue, 31 Mar 2020 10:57:39 +0200 Message-Id: <20200331085429.255371508@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Chan [ Upstream commit 62bfb932a51f6d08eb409248e69f8d6428c2cabd ] Other shutdown code paths will always disable PCI first to shutdown DMA before freeing context memory. Do the same sequence in the error path of probe to be safe and consistent. Fixes: c20dc142dd7b ("bnxt_en: Disable bus master during PCI shutdown and driver unload.") Signed-off-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -11959,12 +11959,12 @@ init_err_pci_clean: bnxt_hwrm_func_drv_unrgtr(bp); bnxt_free_hwrm_short_cmd_req(bp); bnxt_free_hwrm_resources(bp); - bnxt_free_ctx_mem(bp); - kfree(bp->ctx); - bp->ctx = NULL; kfree(bp->fw_health); bp->fw_health = NULL; bnxt_cleanup_pci(bp); + bnxt_free_ctx_mem(bp); + kfree(bp->ctx); + bp->ctx = NULL; init_err_free: free_netdev(dev);