Commit 5a2815f0 authored by Itai Garbi's avatar Itai Garbi Committed by Roland Dreier

IPoIB: Don't attempt to release resources on error flow

If the ipoib client info isn't found on the _remove_one callback, we
must not attempt to scan the returned null list.  Found by Coverity.
Signed-off-by: default avatarItai Garbi <igarbi@mellanox.com>
Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 4b48680b
...@@ -1693,6 +1693,8 @@ static void ipoib_remove_one(struct ib_device *device) ...@@ -1693,6 +1693,8 @@ static void ipoib_remove_one(struct ib_device *device)
return; return;
dev_list = ib_get_client_data(device, &ipoib_client); dev_list = ib_get_client_data(device, &ipoib_client);
if (!dev_list)
return;
list_for_each_entry_safe(priv, tmp, dev_list, list) { list_for_each_entry_safe(priv, tmp, dev_list, list) {
ib_unregister_event_handler(&priv->event_handler); ib_unregister_event_handler(&priv->event_handler);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment