From patchwork Mon Jul 17 19:55:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 121588 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1326165vqt; Mon, 17 Jul 2023 13:21:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlEcQs0Cuv9qN/VqAmpVj+/C4KrMGhra6uQQACIv6HjXpTlscfrgnAgvXHZh/rdlU4a8BCcf X-Received: by 2002:a17:906:6682:b0:992:7462:a22c with SMTP id z2-20020a170906668200b009927462a22cmr10913504ejo.36.1689625293821; Mon, 17 Jul 2023 13:21:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689625293; cv=none; d=google.com; s=arc-20160816; b=hMzZltg465YzxJAiPn66wK3eQVtC4RkgcXMo4C2phB+jvhMc8bGPWBIkSYPT1FX7vR sOTd+eX617ZgM1aFyEV44Qq1FRJ/WJK5xhJ63WCSwapXgJ4rRlBLMWLgWPD+CKsZurjj rCAf5wj8JtAllFURvR8VDCmaWZnaLn9DryOaOFEWpPs46SffBK/KKrblDhVyLFYL1AEv zYxikPZEGTPoTxxrQr00ngRVgGLqeMqSCoqe49AiTcFulzEH9h3xS2CYAiAaiTyuFv/4 mgC7IxZyY/wIsxOVUK7+1D6BD1jQV6aOVtcAvQvw8pBAApbc7VvVlUaVwRtT1cY+kNMr k3ww== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=4YAwP+0IebCJzWu8q4z7IgX7pVQZaDGiqk8B5XyDXic=; fh=eZwDg83LqUhlovn7/YTl/A0b9Q+0nk+UAgvXXfCcQrA=; b=YsSw5l25OLgI91vMI/pJW5LRohLUYPMLphignQoXxmrXLnR9YqiuhPm5yyeoWFcxO+ ZCbsbGSRuDUUNCVXJTRBgigFTZ2DQ/n9vtO3lUAVERg9BfdooOVWnr3BzguQ2hLpDkVB uMX8r6VPHjh7keSbDKXlPvlpE8twhuy0DpM67WXLqG0gnt40Yb0odDtQhKUiDod0TMHM wZpSohl3vTja3CMZTbyjNJYV2OFUNBkwomtfqBHb1bO+nP2dSUZJb3G5Km0kWxu0Qi8j CpvIe6s37Jtahm0JZVjcCCBo7lUzs06VLGgYYh0eifO9zICRQ3ltMNV4QKAybW1dwt3Q sqvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=KTDNknVS; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q4-20020a170906770400b009929ca58b4fsi122839ejm.62.2023.07.17.13.21.08; Mon, 17 Jul 2023 13:21:33 -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=@wanadoo.fr header.s=t20230301 header.b=KTDNknVS; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230059AbjGQT4i (ORCPT + 99 others); Mon, 17 Jul 2023 15:56:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229793AbjGQT4f (ORCPT ); Mon, 17 Jul 2023 15:56:35 -0400 Received: from smtp.smtpout.orange.fr (smtp-22.smtpout.orange.fr [80.12.242.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFC3D1BE3 for ; Mon, 17 Jul 2023 12:56:11 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id LUK5qOYC7Bp2FLUK5qxFRQ; Mon, 17 Jul 2023 21:55:58 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1689623758; bh=4YAwP+0IebCJzWu8q4z7IgX7pVQZaDGiqk8B5XyDXic=; h=From:To:Cc:Subject:Date; b=KTDNknVSqCSWDbhFb//j0yR90QyYkfnGzthyyuJCcN+tsB/lv676W38cwOlukZoDd AoWIg9nNYIsrUNZLD0rTTDay5ldWLQq1gubP0OsqXb9jP8XNLx6C8SQl6Om807RyW7 mcNoWXMAgVfGPzsM4dZ7FNMqd4BSdnbgou1RhmS+n5DtYqaWVFxOAPO5kZ1Cz2ITNS NBzJZw01E5NIFRDIecCfZjCVxzIGmtihVhkO7JRwkxj5xpiBILUsartnvsH2rLFne4 TJfYrE52V7zU/rsFNn3rKASXw2KZmACcwAw0xivwyovqM+6pBwNAI7TgqKV2TA6/R3 gI1U+bt8JVmQA== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 17 Jul 2023 21:55:58 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Zhu Yanjun , Jason Gunthorpe , Leon Romanovsky , Bob Pearson Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-rdma@vger.kernel.org Subject: [PATCH] RDMA/rxe: Fix an error handling path in rxe_bind_mw() Date: Mon, 17 Jul 2023 21:55:56 +0200 Message-Id: <43698d8a3ed4e720899eadac887427f73d7ec2eb.1689623735.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771700531965527889 X-GMAIL-MSGID: 1771700531965527889 All errors go to the error handling path, except this one. Be consistent and also branch to it. Fixes: 02ed253770fb ("RDMA/rxe: Introduce rxe access supported flags") Signed-off-by: Christophe JAILLET Reviewed-by: Bob Pearson Acked-by: Zhu Yanjun --- /!\ Speculative /!\ This patch is based on analysis of the surrounding code and should be reviewed with care ! /!\ Speculative /!\ --- drivers/infiniband/sw/rxe/rxe_mw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/sw/rxe/rxe_mw.c b/drivers/infiniband/sw/rxe/rxe_mw.c index d8a43d87de93..d9312b5c9d20 100644 --- a/drivers/infiniband/sw/rxe/rxe_mw.c +++ b/drivers/infiniband/sw/rxe/rxe_mw.c @@ -199,7 +199,8 @@ int rxe_bind_mw(struct rxe_qp *qp, struct rxe_send_wqe *wqe) if (access & ~RXE_ACCESS_SUPPORTED_MW) { rxe_err_mw(mw, "access %#x not supported", access); - return -EOPNOTSUPP; + ret = -EOPNOTSUPP; + goto err_drop_mr; } spin_lock_bh(&mw->lock);