Skip to content

Commit

Permalink
IPoIB: Don't attempt to release resources on error flow
Browse files Browse the repository at this point in the history
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: Itai Garbi <igarbi@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
  • Loading branch information
Itai Garbi authored and Roland Dreier committed Feb 19, 2013
1 parent 4b48680 commit 5a2815f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/infiniband/ulp/ipoib/ipoib_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1693,6 +1693,8 @@ static void ipoib_remove_one(struct ib_device *device)
return;

dev_list = ib_get_client_data(device, &ipoib_client);
if (!dev_list)
return;

list_for_each_entry_safe(priv, tmp, dev_list, list) {
ib_unregister_event_handler(&priv->event_handler);
Expand Down

0 comments on commit 5a2815f

Please sign in to comment.