i40iw: Validate correct IRD/ORD connection parameters
authorTatyana Nikolova <tatyana.e.nikolova@intel.com>
Fri, 22 Dec 2017 15:47:01 +0000 (09:47 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Apr 2018 10:32:11 +0000 (12:32 +0200)
commitfbd4d9046a1a0f32b9a3b82871a1b3c7fd52a758
tree727bd91ed1cda69c74157354fb7d304718e60ac7
parentc5cd3cc217a914975d969db99edea13ab6265283
i40iw: Validate correct IRD/ORD connection parameters

[ Upstream commit ce9ce74145aa6814a370a9ff4f5a1d719baaced1 ]

Casting to u16 before validating IRD/ORD connection
parameters could cause recording wrong IRD/ORD values
in the cm_node. Validate the IRD/ORD parameters as
they are passed by the application before recording
them.

Fixes: f27b4746f378 ("i40iw: add connection management code")
Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/i40iw/i40iw_cm.c