aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/bnxt_re/ib_verbs.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2019-02-11 13:34:15 +0000
committerJason Gunthorpe <jgg@mellanox.com>2019-02-11 15:34:54 -0700
commita87145957eb9c474559b3acd2cfc6e8914b0e08f (patch)
tree608748fbe6ab3d863b8daa3a8dc3fcb5f6b59179 /drivers/infiniband/hw/bnxt_re/ib_verbs.c
parentRDMA/mlx5: Fix memory leak in case we fail to add an IB device (diff)
downloadlinux-dev-a87145957eb9c474559b3acd2cfc6e8914b0e08f.tar.xz
linux-dev-a87145957eb9c474559b3acd2cfc6e8914b0e08f.zip
RDMA/bnxt_re: fix or'ing of data into an uninitialized struct member
The struct member comp_mask has not been initialized however a bit pattern is being bitwise or'd into the member and hence other bit fields in comp_mask may contain any garbage from the stack. Fix this by making the bitwise or into an assignment. Fixes: 95b86d1c91ad ("RDMA/bnxt_re: Update kernel user abi to pass chip context") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Devesh Sharma <devesh.sharma@broadcom.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/bnxt_re/ib_verbs.c')
-rw-r--r--drivers/infiniband/hw/bnxt_re/ib_verbs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
index bff9320a968e..2ed778683c6b 100644
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
@@ -3702,7 +3702,7 @@ struct ib_ucontext *bnxt_re_alloc_ucontext(struct ib_device *ibdev,
}
spin_lock_init(&uctx->sh_lock);
- resp.comp_mask |= BNXT_RE_UCNTX_CMASK_HAVE_CCTX;
+ resp.comp_mask = BNXT_RE_UCNTX_CMASK_HAVE_CCTX;
chip_met_rev_num = rdev->chip_ctx.chip_num;
chip_met_rev_num |= ((u32)rdev->chip_ctx.chip_rev & 0xFF) <<
BNXT_RE_CHIP_ID0_CHIP_REV_SFT;