Code Review
/
linux-3.10.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[linux-3.10.git]
/
drivers
/
infiniband
/
core
/
cma.c
diff --git
a/drivers/infiniband/core/cma.c
b/drivers/infiniband/core/cma.c
index ee946cc2576ba508667bcc0a8755e914f9b2129a..0751697ef984a87e7f688238a10760127fd7383f 100644
(file)
--- a/
drivers/infiniband/core/cma.c
+++ b/
drivers/infiniband/core/cma.c
@@
-2803,11
+2803,12
@@
static void cma_remove_one(struct ib_device *device)
static int cma_init(void)
{
static int cma_init(void)
{
- int ret, low, high;
+ int ret, low, high
, remaining
;
get_random_bytes(&next_port, sizeof next_port);
inet_get_local_port_range(&low, &high);
get_random_bytes(&next_port, sizeof next_port);
inet_get_local_port_range(&low, &high);
- next_port = ((unsigned int) next_port % (high - low)) + low;
+ remaining = (high - low) + 1;
+ next_port = ((unsigned int) next_port % remaining) + low;
cma_wq = create_singlethread_workqueue("rdma_cm");
if (!cma_wq)
cma_wq = create_singlethread_workqueue("rdma_cm");
if (!cma_wq)