]> err.no Git - linux-2.6/commit
RDMA/cma: Fix initialization of next_port
authorSean Hefty <sean.hefty@intel.com>
Tue, 5 Jun 2007 16:57:31 +0000 (09:57 -0700)
committerRoland Dreier <rolandd@cisco.com>
Fri, 8 Jun 2007 06:24:38 +0000 (23:24 -0700)
commitbf2944bd56c7a48cc3962a860dbc4ceee6b1ace8
treeb6255f3830965ddc615a0b872bd3c4bbfa1bf492
parent57f01b53398baebd809e7efd49fc10c10174b46d
RDMA/cma: Fix initialization of next_port

next_port should be between sysctl_local_port_range[0] and [1].
However, it is initially set to a random value with get_random_bytes().
If the value is negative when treated as a signed integer, next_port
can end up outside the expected range because of the result of the %
operator being negative.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/core/cma.c