From patchwork Fri Nov 20 07:44:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 11919629 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,MIME_HEADER_CTYPE_ONLY, MIME_NO_TEXT,SPF_HELO_NONE,SPF_PASS,T_TVD_MIME_NO_HEADERS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7150CC71155 for ; Fri, 20 Nov 2020 07:45:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0554D222BA for ; Fri, 20 Nov 2020 07:45:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="iRhzzVSd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727235AbgKTHo6 (ORCPT ); Fri, 20 Nov 2020 02:44:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726118AbgKTHo5 (ORCPT ); Fri, 20 Nov 2020 02:44:57 -0500 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AF5CC0613CF for ; Thu, 19 Nov 2020 23:44:57 -0800 (PST) Received: by mail-pf1-x442.google.com with SMTP id w6so7086507pfu.1 for ; Thu, 19 Nov 2020 23:44:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=R+yVBRkqZ9OgtS/66Fbx9sUjBe3rG7XHFcEiFWHjKG0=; b=iRhzzVSdDu5YTYDSGANB2a8kHKE+z9Ly1Agf8HAJAdfOoPbWpSM7OfY1ByLT275bvV m663jUMCWeo0JNMoQaQmXB90SJv0IhzVLGxaLQ5mdfm1G+7stJAf2fQauv4Edi1aab7a epktchj+KOuosHJuSDMGirKLjX0bSAlGaUi2s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=R+yVBRkqZ9OgtS/66Fbx9sUjBe3rG7XHFcEiFWHjKG0=; b=jkKY63lTw+fIe6z8kxTg37xntHzdDyHwEkiNIoqXWAnLDPsgqLGAa7mjWwFJ5JjThU 9YUgAMNMlRkPuWelZq8/YgDe/YKB4kEbPChuEnmLjmYcEeyibohMnRQIEo3v/KMuoT6Q Jdaua7wb6EfsMdum8n2cQBKfJ6j8YNs55rkmgZdMuUC4pBQobB+bG4/A4uFMMPhE1pHE A0tncPEXi1eLcrGi0iUhwLHuXg2YFN/C5AsYh63HbE00DKAY7JTgxGbMTe13jaCzgMgP iGN47g39/6R8rcMW/Bvn6k0LzeU6XpI3UgPYsCTnxaHZlJj2BlNLrt+NGOeCJhCUW23T YR8A== X-Gm-Message-State: AOAM532YgfyPL4c6IEVpOc552nM92BA/GPmetudWxky80aiM+F3TxVp2 GzNqEbmS1XKDbP/sRX7X9ZoWAQ== X-Google-Smtp-Source: ABdhPJwTelipj9ehJ4KRetSvvpUJIGlH568MRVliXW/CZiDxZzlMdQz9J7xJrkuCPywcvinXZD5S6w== X-Received: by 2002:aa7:8552:0:b029:18e:f030:e514 with SMTP id y18-20020aa785520000b029018ef030e514mr12208799pfn.2.1605858296763; Thu, 19 Nov 2020 23:44:56 -0800 (PST) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id 23sm2085603pgs.19.2020.11.19.23.44.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Nov 2020 23:44:56 -0800 (PST) From: Michael Chan To: kuba@kernel.org Cc: netdev@vger.kernel.org, gospo@broadcom.com Subject: [PATCH net] bnxt_en: Release PCI regions when DMA mask setup fails during probe. Date: Fri, 20 Nov 2020 02:44:31 -0500 Message-Id: <1605858271-8209-1-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Jump to init_err_release to cleanup. bnxt_unmap_bars() will also be called but it will do nothing if the BARs are not mapped yet. Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.") Reported-by: Jakub Kicinski Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 6e8329534cde..0af0af2b70fe 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -11591,7 +11591,7 @@ static int bnxt_init_board(struct pci_dev *pdev, struct net_device *dev) dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)) != 0) { dev_err(&pdev->dev, "System does not support DMA, aborting\n"); rc = -EIO; - goto init_err_disable; + goto init_err_release; } pci_set_master(pdev);