[PATCH] RDMA/irdma: Initialize struct members in irdma_reg_user_mr()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The ib_copy_from_udata() function does not always initialize the whole
struct.  It depends on the value of udata->inlen.  So initialize it to
zero at the start.

Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
What I know is that RDMA takes fast paths very seriously.

This is probably a fast path so you may want to implement a different
solution.  If you want to do something else then, just feel free to do
that and give me a Reported-by tag.

That business about you guys trying to explain what you want me to type
and then I wait for a day and resend but I misunderstood something so
I have to redo it again.  You all are very dear to my heart, but what a
headache!  None of us need a long back an forth over trivial stuff like
this.  It's just easier for everyone if people write their own patches.
It takes five minutes instead of three days or whatever.

 drivers/infiniband/hw/irdma/verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
index c4412ece5a6d..8f4a6b7ebcce 100644
--- a/drivers/infiniband/hw/irdma/verbs.c
+++ b/drivers/infiniband/hw/irdma/verbs.c
@@ -2741,7 +2741,7 @@ static struct ib_mr *irdma_reg_user_mr(struct ib_pd *pd, u64 start, u64 len,
 	struct irdma_pbl *iwpbl;
 	struct irdma_mr *iwmr;
 	struct ib_umem *region;
-	struct irdma_mem_reg_req req;
+	struct irdma_mem_reg_req req = {};
 	u32 total, stag = 0;
 	u8 shadow_pgcnt = 1;
 	bool use_pbles = false;
-- 
2.35.1




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux