From patchwork Tue Jun 28 11:25:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9202965 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 209FE6075F for ; Tue, 28 Jun 2016 11:25:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 107FD271FD for ; Tue, 28 Jun 2016 11:25:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04DEE285BE; Tue, 28 Jun 2016 11:25:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37B12271FD for ; Tue, 28 Jun 2016 11:25:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752394AbcF1LZ3 (ORCPT ); Tue, 28 Jun 2016 07:25:29 -0400 Received: from mail-bn1bon0078.outbound.protection.outlook.com ([157.56.111.78]:50713 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752098AbcF1LZY (ORCPT ); Tue, 28 Jun 2016 07:25:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=wvQSKVpC+uqzmgZeTAC9DejGJzFYvlclLccP9QTnEx8=; b=CRM3VgEd93/4NNO9AnbI3G/O6KevAfzeM2GdR7pmnxF65phqYEoBlami7xr6+B4s+jH6T+8WRMHYk+GyuYv9XTVFhG/dDKL5xCwXBXCkyiKu7CH3nSx68YkLyBb0LUVKxq3frO5nTYbMf3G3/Z18ZjCBrjvMR1uiSg80cnEtWr8= Received: from BY2PR02CA0106.namprd02.prod.outlook.com (10.163.44.160) by BN1PR0201MB0801.namprd02.prod.outlook.com (10.160.170.146) with Microsoft SMTP Server (TLS) id 15.1.523.12; Tue, 28 Jun 2016 11:25:20 +0000 Received: from BN1AFFO11FD032.protection.gbl (2a01:111:f400:7c10::102) by BY2PR02CA0106.outlook.office365.com (2a01:111:e400:5261::32) with Microsoft SMTP Server (TLS) id 15.1.528.16 via Frontend Transport; Tue, 28 Jun 2016 11:25:20 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by BN1AFFO11FD032.mail.protection.outlook.com (10.58.52.186) with Microsoft SMTP Server (TLS) id 15.1.523.9 via Frontend Transport; Tue, 28 Jun 2016 11:25:19 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [172.22.12.162]) (using TLS with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 83.40.03023.E4D52775; Tue, 28 Jun 2016 04:19:42 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.279.2; Tue, 28 Jun 2016 04:25:18 -0700 X-AuditID: ac160c69-33fff70000000bcf-c2-57725d4e03ef Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 7E.C5.03875.B9E52775; Tue, 28 Jun 2016 04:25:17 -0700 (PDT) Subject: [PATCH 1/5] IB/core: Make rdma_rw_ctx_init() initialize all used fields To: Doug Ledford References: <419391ba-0c39-11ce-f249-84b428dc73d5@sandisk.com> CC: Christoph Hellwig , Sagi Grimberg , "Nicholas A. Bellinger" , Parav Pandit , Laurence Oberman , "linux-rdma@vger.kernel.org" From: Bart Van Assche Message-ID: <91e53f7b-fdb6-bd66-ada6-982c641c2048@sandisk.com> Date: Tue, 28 Jun 2016 13:25:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <419391ba-0c39-11ce-f249-84b428dc73d5@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjkeLIzCtJLcpLzFFi42JZI8azSNcvtijcYM8uA4uX5z+wWqxcfZTJ 4tmhXhaL8x9eMVm0rT7DaNF4ycBi3ev3LA7sHjtn3WX3OH9vI4vH/e1HmDx232xg83i/7yqb x+dNcgFsUVw2Kak5mWWpRfp2CVwZq+5tZCuYLl5x/tV5lgbG20JdjJwcEgImEv3HvrF2MXJx CAnMZZL4t3cplLODUeLSsZmMMFUnD31ig0gsZZS48f8xWEJYIEhi4qp+ZhBbREBNYtOrRewg tpCAncSbtu/MIA3MAs1MErt+n2MCSbAJGEl8ez+TBcTmBSpa/mIFWAOLgKrEvYVnwIaKCkRI 9P5aAlUjKHFy5hMwm1PAXuLw6ZdAV3AADdWUWL9LHyTMLCAvsf3tHLBdEgJHWSWOLN/FAnGE usTJJfOZJjAKz0IyahZC+ywk7QsYmVcxiuVm5hTnpqcWGJrqFSfmpWQWZ+sl5+duYoTETuYO xrtPvA8xCnAwKvHw7qgrDBdiTSwrrsw9xCjBwawkwvsKGHlCvCmJlVWpRfnxRaU5qcWHGKU5 WJTEed3ufQkTEkhPLEnNTk0tSC2CyTJxcEo1MN4MONr5vdwzTP2iOmOfx8aODKvwxzcUtU4Y iW2QyrZet2nehnlrv78ovFQtMyXRrs8uU/vr+xtJvxonbk8sq3n1zd9qlnrcYrH+G4UxYsdM T7Uw7+2eYlSvdmPxfiFWs/cFbo0dqhr8ioG7Nk158/B1TkTf3TdP3Pzv/xXJnPidSzhIMKR+ jRJLcUaioRZzUXEiAFhIQK6ZAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNJMWRmVeSWpSXmKPExsXCtZEjRXduXFG4wYrnRhYvz39gtVi5+iiT xbNDvSwW5z+8YrJoW32G0aLxkoHFutfvWRzYPXbOusvucf7eRhaP+9uPMHnsvtnA5vF+31U2 j8+b5ALYorhsUlJzMstSi/TtErgyVt3byFYwXbzi/KvzLA2Mt4W6GDk5JARMJE4e+sQGYgsJ LGaUaHpXAWILCwRJTFzVzwxiiwioSWx6tYgdosZO4k3bd7A4s0Ark0T7VxkQm03ASOLb+5ks IDYvUM3yFyvA6lkEVCXuLTzDCGKLCkRI9P5aAlUjKHFy5hMwm1PAXuLw6ZdsEDPVJf7MuwQ1 X15i+9s5zBMY+WYhaZmFpGwWkrIFjMyrGMVyM3OKc9MzCwyN9IoT81Iyi7P1kvNzNzGCg5cz agfj9YnmhxiZODilGhgr9RcrvX842WuZH0un/cwvU9o8bzwLv28n3sVspDtj+oYZMTPtXaqn +WvVv+O9eOvxjQeXFBkOrbb997isIzNto0BdbGGZ6C2jO0GG++apvju1oDzNa5FYD1uOt2hH zvcjDdOSUlM/lqidtE8v/fWieNmWiUZbGHIft50WP14TuWnnLa77+XJKLMUZiYZazEXFiQCZ 6O0yDgIAAA== X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(189002)(199003)(189998001)(92566002)(33646002)(31686004)(6806005)(2270400002)(50466002)(7696003)(2950100001)(356003)(4326007)(68736007)(229853001)(305945005)(7846002)(586003)(64126003)(8936002)(81156014)(2906002)(8676002)(5003600100003)(47776003)(36756003)(86362001)(65956001)(65806001)(4001350100001)(19580395003)(19580405001)(69596002)(106466001)(83506001)(76176999)(54356999)(50986999)(230700001)(97736004)(11100500001)(77096005)(110136002)(87936001)(81166006)(23676002)(53416004)(31696002)(65826006); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0201MB0801; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD032; 1:PFVZjt9AxZ9gLfjZQImTAEb/IqSTGSeLKz2gUi2eBiFitVZDGBzdzLmaS9NRKuLX+tz34FSrm61jLrJzbZVwZnNxnprndYElWdtgsUcr6FKH2t8mwpPvglrMl1HmoTJuibK7T7OZ/rytJ41u2BvLhjrfAw9nzYtii+kM9wU8n/ZUrPY0aLbbPQUie3UJnKivH2lxOZATxHVSLMRZfjWYzhQlF73EvYM5iW3sHGx3YActS3g/a3y+YlFpgXWU9Cx/jhHdXVkLvmmFoiLrICoo8P2YHa1laCZskVD6S+LNxU7vUbrCL9XxdIi3i6qUA6bQ1zLDoOlGE4k94Rjzc6AD3qHtzylVXOs7i+3aB9MYDQpsIc8b09bhS+sPbd7LEh3AsadpPMVvjX3uRI+cgPXptzetJeypiqX3wbiOUSx3UW6kwh0G6thu9/Tehdi7JOFKJXc6NGCUZ5DAhsl62cM1uh6VeP4uLaRca+21bOcFGhpXvXNdRKDGMYUW/k4/e7Oix1NALn5A/CqTweLWkUVSJA== X-MS-Office365-Filtering-Correlation-Id: 458882e9-9720-4396-3d04-08d39f46e364 X-Microsoft-Exchange-Diagnostics: 1; BN1PR0201MB0801; 2:Oi+wCQ9npwtfTkA7cMj879wT10XInmUoni/Tm6iBEeeuAlIOTTeBJWtqh8Ic9LTSrMYthR4JtDeV1RgpuodAUCaL30L12tpOYB1tutW2tiTP3KHPLmRy1Kl2py1bHsThPLAqvLtNQwqnWjCzxZYPhZTmxNZSmZeEZKLqnoeVLaYopC43Q7hZz+14RUQ1HbZK; 3:4IKwmrB/Jal1vHgiXpH/rj64fuUTX2R+o/8I8QK0lmQs83YJurlBhgwXzm4X0sdd0up5v2NOXXIsGizpdUfkmz3TDI/i6YHSKP2uaLHwmm8UU18++X+XPUTDEYlqC9T2YB6TwMtx4vYR/u7/gPpDglSqsRp5dHtPoENqVrbCBfxrFerzgqOty3bFOfUPu4j3Kuav188c3nmEI2xQ5W/w0kSfLI1qjULZop1QfIy2WvANEOsnwl5bgCfsi6EVMctQZUesh1/88ni9/zNYbCdgzQ==; 25:yfyjR7a9NAbtv5Vd+OKIyb7C4dua8sQDaFJdiuaTMYRUTaw/xI0AlcHLpkd28+olElFbvGTOnMIv4bcRHjgutJshdYicg5TO02fnXoUmzXzagiWL0wsN+Qi3dWCDCQRdql7bDg9C1v+QhK0RhgyuAEnAmrAKdC04QYReNrTLUF/cB4jbwLsCq3F1TtrKluafmpFFOGSrZ7tlD00MMkQFdW0P/4DpIKFNAHdo3c/in88ByQde/LFX8ioewv8F2aeJMR9rasP+6poG8ZThY9892jbaxgMtG7gXHEKVM2uYeoN9N493S/10WrpuFO/Vw/ogBpGw2oEjkJ+kqi3bcbKn04upfphZNrM3rZa65xl/1z86kWhBifJQ7Gt9gTZnCNFDrDvGZDUOjwI3sdGy3BVYuVKuDvLx2LmT1Co6hiXmrxY= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:BN1PR0201MB0801; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0201MB0801; 20:4CnJFSpdoiWyEriUWtF4iknnAbyReo0L3qjBDuyAf9vOMa7rC7zJ/NAwcPncUnYVjb2/3JUYFcXPHgjcyOiI8d9xK4o/NeCQt2E58xjdfaha0Jtsf2XL/0mf2gP8bCHL/Hlw9f0YbizjG9xK8gSof3C1iDqDvbNcixoQ86hP+AWSdggtQm3bNXrA8opGPuko+YBuMUoQ1qCdeJ873iX+pkingkErcZfCCUlm36ZbKQakiek1/xlaeXv7pkeWbmSed5SG1vf4DFS/PJXCTzwLU6vpEHRXaXYYq6W/uf0CXbl+C3rCRzphCMEse/UVYGX5yj4U1ZM5WZWy7MaXxzD06MvMYuZEevam1FtnTH56rtjWitOhcDTHkWqrEhnhLjO7i05KySbpwqYsUyYgiL5jZJNLLdDWM3BwnqMQcZXBXsUrjMT3ToGvKqBGhayo+BxKq/CMeK+fk7zRg1poWCVppfLK9VobpXS9XpaMpFtXrSM5IOB7kB6hz1XvtaInuDyN X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(10201501046)(3002001)(6055026); SRVR:BN1PR0201MB0801; BCL:0; PCL:0; RULEID:; SRVR:BN1PR0201MB0801; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0201MB0801; 4:B3LkStB222L+QlJTWGq916KLuyiF5r+ckdFPg9EA7NomjZddrzGGbrCpXOEr7q38qgDwxKq2E7+V3FPjAet+RjxUxAoEodihFZtuemFOOL7fW6CYxwlU5UxE4yAsmKSlP2lSVBdyH2efuPSXWQPr1MnmFf98zZA/WBtgmv0cnjOmINj+06Dk5UQLLt1wabMmJdCVmFmD96ip+9IJ98/6VO7ZEhGKQBnFdA/VMrFtbg0BaAm21DDjrPzk1Cxt7gyyWeXNMsIUrSkJwEBk8Ulf2xY9DDoZRk+3ri4KCUaz59gl8WLCybhy56lZNZBeCa90oRTIbAY9I3pWukvqyEJKunVmRJUN+HDxsSUw32IthY82H/KGzWnZM/vY0O4uD4GD4FEoa5e1H6/OlNoZgwDvG/6/xe7HdKHkD2KNT7BXkKWbpOymo1bub6LB8Mkm2Y4c20sqzQYag1PQD6nvYYqaTMddMZJKa7h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6qWcZ6931zYv2FcvhoAvKt8rLt6S1flxIO?= X-Microsoft-Exchange-Diagnostics: 1; BN1PR0201MB0801; 6:eteEX/V0tzzOrxicQpbNWSGZGhi5yhi7kYwF5PLquPZd4wLEQENHcO6+SrRDEqqtCNyYRQK7tpiaPD81olmBBhyqRvzXH+v/J2KbiIpAz6W0cudnZoEENF7MANCagCS26LZdkwqsd889/LTrrL4/mg6O3dXpLlggwqB0B+txFFeiqc+TtFFl/WI1q4akb8fCjjXvbeFifLi4qBd7oRvZTUYOYNH13OAAxBpghlxtokY07r7BDoYNhB282+kcVSKjXCNO6YY1lWGc9NiluyGkcRRc79I9gWRKlT96T7QK4v+TymOMCNRVGH7k33cPhuD00UwWZG4vCMknoZwUBIbf4DfcCCPwElRJIWv891siCIc=; 5:cmnIQcOh5PPE/2zmeFFjVQDDDwipB08xq3iJG07j6MzPJ/OoejGsjncCCrJXfmYSMhWZoLtqESvqlg0aF6uiJ2RbgOcCGrB3ty4v/J+M8tfHy8HUFczzVJu5PjVesq56n01eSmp8+3C8L0WagADoRQ==; 24:DlStiq0w5LY4lyERoLkiATR2F+9ZD9kAuMhN5Wx780wCP2chqrrPDd3rYIIwQ5w+W8CV4g0E19Oq23wBYa+LKnM9ykhueKOajdH8Ll6k5Pk=; 7:uWovUZCuwLSUch4Io38b9F/DWopYfh2iuAaxXApQFUm36KuKzHscR4ETMBmSfhK1M3ijIucuguBdPvVhHurgkSiESOn0UQTM9JuU8agP4Z+tYdtHzSOVpkjjp1UlRof8KJvdcOJjly1ULJnS9TFmGT+rwREsJPcvvQYDM9IwbbgNlaRTtaew7QNvMV+/6yj+8XR6ltURzCtAzPfY9V1VF3krQeyaYpEkuGXyOe6mmQ4Gos1uZJIku/Iw3vSlypZE8IFLDCzQ4iPa9UGl/rl/iA== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN1PR0201MB0801; 20:+QkG98e5GFiytQBlXrtvWa98Sn5OHf3z1GeVQG1HIYM//24aJIHlVi8yg0iXoMnnIvQ2W/zS7VN/LWNBVsqCkJ0bPAb6TBYi/rGaPKFz40WVwKL0sRbKCgsxw18s1kO1a8OEEyTpzqeTiAzIgpR+eGAEJGb+EidI7REAXUgN9KawMqC06Xdia/GPiv9/ZLikANYHUDbYq2Od0v2YSLHVBMGb9XhR0f91xjBbGq9vZtFFNBjWJJYJJERzIUXCszsh X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2016 11:25:19.4188 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR0201MB0801 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some but not all callers of rdma_rw_ctx_init() zero-initialize struct rdma_rw_ctx. Hence make rdma_rw_ctx_init() initialize all work request fields that will be read by ib_post_send(). Fixes: b99f8e4d7bcd ("IB/srpt: convert to the generic RDMA READ/WRITE API") Signed-off-by: Bart Van Assche Cc: #v4.7+ Cc: Christoph Hellwig Cc: Sagi Grimberg Cc: Nicholas Bellinger Cc: Parav Pandit Cc: Laurence Oberman --- drivers/infiniband/core/rw.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/core/rw.c b/drivers/infiniband/core/rw.c index 1eb9b12..13d4067 100644 --- a/drivers/infiniband/core/rw.c +++ b/drivers/infiniband/core/rw.c @@ -99,6 +99,7 @@ static int rdma_rw_init_one_mr(struct ib_qp *qp, u8 port_num, } reg->reg_wr.wr.opcode = IB_WR_REG_MR; + reg->reg_wr.wr.next = NULL; reg->reg_wr.mr = reg->mr; reg->reg_wr.access = IB_ACCESS_LOCAL_WRITE; if (rdma_protocol_iwarp(qp->device, port_num)) @@ -114,6 +115,7 @@ static int rdma_rw_init_mr_wrs(struct rdma_rw_ctx *ctx, struct ib_qp *qp, u8 port_num, struct scatterlist *sg, u32 sg_cnt, u32 offset, u64 remote_addr, u32 rkey, enum dma_data_direction dir) { + struct rdma_rw_reg_ctx *prev = NULL; u32 pages_per_mr = rdma_rw_fr_page_list_len(qp->pd->device); int i, j, ret = 0, count = 0; @@ -125,7 +127,6 @@ static int rdma_rw_init_mr_wrs(struct rdma_rw_ctx *ctx, struct ib_qp *qp, } for (i = 0; i < ctx->nr_ops; i++) { - struct rdma_rw_reg_ctx *prev = i ? &ctx->reg[i - 1] : NULL; struct rdma_rw_reg_ctx *reg = &ctx->reg[i]; u32 nents = min(sg_cnt, pages_per_mr); @@ -162,9 +163,13 @@ static int rdma_rw_init_mr_wrs(struct rdma_rw_ctx *ctx, struct ib_qp *qp, sg_cnt -= nents; for (j = 0; j < nents; j++) sg = sg_next(sg); + prev = reg; offset = 0; } + if (prev) + prev->wr.wr.next = NULL; + ctx->type = RDMA_RW_MR; return count; @@ -205,11 +210,10 @@ static int rdma_rw_init_map_wrs(struct rdma_rw_ctx *ctx, struct ib_qp *qp, rdma_wr->wr.opcode = IB_WR_RDMA_READ; rdma_wr->remote_addr = remote_addr + total_len; rdma_wr->rkey = rkey; + rdma_wr->wr.num_sge = nr_sge; rdma_wr->wr.sg_list = sge; for (j = 0; j < nr_sge; j++, sg = sg_next(sg)) { - rdma_wr->wr.num_sge++; - sge->addr = ib_sg_dma_address(dev, sg) + offset; sge->length = ib_sg_dma_len(dev, sg) - offset; sge->lkey = qp->pd->local_dma_lkey; @@ -220,8 +224,8 @@ static int rdma_rw_init_map_wrs(struct rdma_rw_ctx *ctx, struct ib_qp *qp, offset = 0; } - if (i + 1 < ctx->nr_ops) - rdma_wr->wr.next = &ctx->map.wrs[i + 1].wr; + rdma_wr->wr.next = i + 1 < ctx->nr_ops ? + &ctx->map.wrs[i + 1].wr : NULL; } ctx->type = RDMA_RW_MULTI_WR;