linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] staging: rdma: shift wrapping bug in c2_get_dma_mr()
@ 2016-01-08 11:49 Dan Carpenter
  2016-01-08 13:29 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2016-01-08 11:49 UTC (permalink / raw)
  To: Doug Ledford, Christoph Hellwig
  Cc: devel, linux-rdma, Greg Kroah-Hartman, Steve Wise,
	kernel-janitors, Matan Barak, Jason Gunthorpe, Geliang Tang,
	Sean Hefty, Hal Rosenstock

We should be using all 64 bits of page_list[i] instead of just the lower
32.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/staging/rdma/amso1100/c2_provider.c b/drivers/staging/rdma/amso1100/c2_provider.c
index de8d10e..ac6a6ff 100644
--- a/drivers/staging/rdma/amso1100/c2_provider.c
+++ b/drivers/staging/rdma/amso1100/c2_provider.c
@@ -361,7 +361,7 @@ static struct ib_mr *c2_get_dma_mr(struct ib_pd *pd, int acc)
 	}
 
 	for (i = 0; i < pbl_depth; i++)
-		page_list[i] = (i << page_shift);
+		page_list[i] = ((u64)i << page_shift);
 
 	mr = kmalloc(sizeof(*mr), GFP_KERNEL);
 	if (!mr) {

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-19 18:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-08 11:49 [patch] staging: rdma: shift wrapping bug in c2_get_dma_mr() Dan Carpenter
2016-01-08 13:29 ` Christoph Hellwig
2016-01-19 18:13   ` Doug Ledford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).