[ipoib] Fix a race when chain-loading undionly.kpxe in IPoIB
authorWissam Shoukair <wissams@mellanox.com>
Wed, 12 Aug 2015 09:28:58 +0000 (12:28 +0300)
committerMichael Brown <mcb30@ipxe.org>
Mon, 17 Aug 2015 13:42:36 +0000 (14:42 +0100)
commiteb8df9a0466078f083822e5ef2fb16713c94d25c
treef42ae5a6ad32a2e1a04139894cece0c0dc3c3a67
parentfd18417cf1208399bfa0153c6ec26c268d2f948e
[ipoib] Fix a race when chain-loading undionly.kpxe in IPoIB

The Infiniband link status change callback ipoib_link_state_changed()
may be called while the IPoIB device is closed, in which case there
will not be an IPoIB queue pair to be joined to the IPv4 broadcast
group.  This leads to NULL pointer dereferences in ib_mcast_attach()
and ib_mcast_detach().

Fix by not attempting to join (or leave) the broadcast group unless we
actually have an IPoIB queue pair.

Signed-off-by: Wissam Shoukair <wissams@mellanox.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/net/ipoib.c
src/net/infiniband.c
src/net/infiniband/ib_mcast.c