]> git.itanic.dy.fi Git - linux-stable/commitdiff
RDMA/irdma: Use s/g array in post send only when its valid
authorSindhu-Devale <sindhu.devale@intel.com>
Tue, 6 Sep 2022 22:32:43 +0000 (17:32 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Sep 2022 10:39:46 +0000 (12:39 +0200)
commit 2c8844431d065ae15a6b442f5769b60aeaaa07af upstream.

Send with invalidate verb call can pass in an
uninitialized s/g array with 0 sge's which is
filled into irdma WQE and causes a HW asynchronous
event.

Fix this by using the s/g array in irdma post send
only when its valid.

Fixes: 551c46e ("RDMA/irdma: Add user/kernel shared libraries")
Signed-off-by: Sindhu-Devale <sindhu.devale@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Link: https://lore.kernel.org/r/20220906223244.1119-5-shiraz.saleem@intel.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/irdma/uk.c

index 7e6c3ba8df6ab1e6ccd79838f2957fb295cb8377..aecd64a7dbbaffa66a230c1aa48f9e1d46126749 100644 (file)
@@ -501,7 +501,8 @@ enum irdma_status_code irdma_uk_send(struct irdma_qp_uk *qp,
                              FIELD_PREP(IRDMAQPSQ_IMMDATA, info->imm_data));
                i = 0;
        } else {
-               qp->wqe_ops.iw_set_fragment(wqe, 0, op_info->sg_list,
+               qp->wqe_ops.iw_set_fragment(wqe, 0,
+                                           frag_cnt ? op_info->sg_list : NULL,
                                            qp->swqe_polarity);
                i = 1;
        }