IB/IPoIB: Fix bad error flow in ipoib_add_port()
authorAmir Vadai <amirv@mellanox.com>
Wed, 1 Jul 2015 11:31:01 +0000 (14:31 +0300)
committerDoug Ledford <dledford@redhat.com>
Tue, 14 Jul 2015 17:20:10 +0000 (13:20 -0400)
commit58e9cc90cda7bc732856a2ad3210328fbc4f6ca2
tree0694dd261c7ff755cd26435a395d9c2654de9ff5
parent8a7ff14dcb40bade309cd2ad04c746bb1d169c4e
IB/IPoIB: Fix bad error flow in ipoib_add_port()

Error values of ib_query_port() and ib_query_device() weren't propagated
correctly. Because of that, ipoib_add_port() could return NULL value,
which escaped the IS_ERR() check in ipoib_add_one() and we crashed.

Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/ulp/ipoib/ipoib_main.c