From patchwork Thu Aug 10 04:44:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13348764 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A789FC001B0 for ; Thu, 10 Aug 2023 04:56:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230168AbjHJE4Z (ORCPT ); Thu, 10 Aug 2023 00:56:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229902AbjHJE4Z (ORCPT ); Thu, 10 Aug 2023 00:56:25 -0400 Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAEB01BCF for ; Wed, 9 Aug 2023 21:56:24 -0700 (PDT) Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6bcb5df95c5so494374a34.1 for ; Wed, 09 Aug 2023 21:56:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1691643384; x=1692248184; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=Gmf/IkFBFukGyxHoRFruSzCiAcIlplQqzDWBnB35TCw=; b=Q8EmfQl+/XZ2HgasKzDDB8dyfEDOAWLwCVu99kbT2R3j/Jf4cZnWaLDhigCflB27g6 oHjBzSWIw/0Ef7D3pu71VaKTvYKwFqlI3EEv0JriRMKmWrgdhizafm2mj4PrjdIMkYWJ lWH+ELAk+S58M2z1ZnS6d3DuV6YhN/vDWlErs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691643384; x=1692248184; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Gmf/IkFBFukGyxHoRFruSzCiAcIlplQqzDWBnB35TCw=; b=LCOo6szdKzLGo9Ycm1bzzohiX5l+D29sPH3wqkyYM1Uw9hHz0CYsOBPWThqspafI6V jHzZF+I/lSotPhCVsot0gwJ6LEMXtxk55CvjKQE702aGp6VALhyUEVuQ8ZXD06QMysQB NEAft8rAveMy9C40qQgi9S8QnGVSB/iUPNP+Niv4j0i+tw3TjmwGs1nsuPO1yaHSFJxS 7hBR8LLvgg5joSC68PfIGW9umcJLL8AMIcP6uuUoOyo1a9+gd5NpkGR+d661OW4/oN1s HyluQRFrSprRrxRH2f1jA8PXrWbo7rQOpF/CFEQ7iUI8gS+equ1Kd956vJSuIz01n5Rc ivVQ== X-Gm-Message-State: AOJu0YxLLNs21fbuGPvTP6JyVwm2L0EajWIxSqWlkYyU+VDLfBHWjH3y GMu5lelkxwF4ATKEeEFpqb2n0w== X-Google-Smtp-Source: AGHT+IE0JNPuvHWaV3m2oCa2socF6VLRFWqTWDwnsB9abrR0rl+lXdkLfTVwbAi09GEEHfl5h/O6Dw== X-Received: by 2002:a05:6358:9492:b0:135:aed4:99b4 with SMTP id i18-20020a056358949200b00135aed499b4mr1681182rwb.4.1691643383859; Wed, 09 Aug 2023 21:56:23 -0700 (PDT) Received: from dhcp-10-192-206-197.iig.avagotech.net.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id x6-20020a63b346000000b00553b9e0510esm458672pgt.60.2023.08.09.21.56.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Aug 2023 21:56:23 -0700 (PDT) From: Selvin Xavier To: jgg@ziepe.ca, leon@kernel.org Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, Kalesh AP , Selvin Xavier Subject: [PATCH for-rc 2/3] RDMA/bnxt_re: Fix error handling in probe failure path Date: Wed, 9 Aug 2023 21:44:36 -0700 Message-Id: <1691642677-21369-3-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1691642677-21369-1-git-send-email-selvin.xavier@broadcom.com> References: <1691642677-21369-1-git-send-email-selvin.xavier@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Kalesh AP During bnxt_re_dev_init(), when bnxt_re_setup_chip_ctx() fails unregister with L2 first before bailing out probe. Fixes: ae8637e13185 ("RDMA/bnxt_re: Add chip context to identify 57500 series") Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index 1c76460..63e98e2 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -1253,6 +1253,8 @@ static int bnxt_re_dev_init(struct bnxt_re_dev *rdev, u8 wqe_mode) rc = bnxt_re_setup_chip_ctx(rdev, wqe_mode); if (rc) { + bnxt_unregister_dev(rdev->en_dev); + clear_bit(BNXT_RE_FLAG_NETDEV_REGISTERED, &rdev->flags); ibdev_err(&rdev->ibdev, "Failed to get chip context\n"); return -EINVAL; }