Message ID | 43698d8a3ed4e720899eadac887427f73d7ec2eb.1689623735.git.christophe.jaillet@wanadoo.fr |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> 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 <rfc822;daweilics@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; 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 <christophe.jaillet@wanadoo.fr> To: Zhu Yanjun <zyjzyj2000@gmail.com>, Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>, Bob Pearson <rpearsonhpe@gmail.com> Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET <christophe.jaillet@wanadoo.fr>, 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 Content-Transfer-Encoding: 8bit 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771700531965527889 X-GMAIL-MSGID: 1771700531965527889 |
Series |
RDMA/rxe: Fix an error handling path in rxe_bind_mw()
|
|
Commit Message
Christophe JAILLET
July 17, 2023, 7:55 p.m. UTC
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 <christophe.jaillet@wanadoo.fr>
---
/!\ 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(-)
Comments
On 7/17/23 14:55, Christophe JAILLET wrote: > 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 <christophe.jaillet@wanadoo.fr> > --- > /!\ 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); Christophe, Good catch. Thanks. Probably should go to for-next. Bob Reviewed-by: Bob Pearson <rpearsonhpe@gmail.com>
On Tue, Jul 18, 2023 at 3:55 AM Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote: > > 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 <christophe.jaillet@wanadoo.fr> > --- > /!\ 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); https://www.kernel.org/doc/Documentation/core-api/printk-formats.rst What is "%#x"? No such definition in the above link. Except that, I am fine with it. Acked-by: Zhu Yanjun <zyjzyj2000@gmail.com> Zhu Yanjun > - return -EOPNOTSUPP; > + ret = -EOPNOTSUPP; > + goto err_drop_mr; > } > > spin_lock_bh(&mw->lock); > -- > 2.34.1 >
On Mon, 17 Jul 2023 21:55:56 +0200, Christophe JAILLET wrote: > All errors go to the error handling path, except this one. Be consistent > and also branch to it. > > Applied, thanks! [1/1] RDMA/rxe: Fix an error handling path in rxe_bind_mw() https://git.kernel.org/rdma/rdma/c/5c719d7aef298e Best regards,
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);