]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
IPoIB: Don't attempt to release resources on error flow
authorItai Garbi <igarbi@mellanox.com>
Tue, 19 Feb 2013 15:40:24 +0000 (15:40 +0000)
committerRoland Dreier <roland@purestorage.com>
Tue, 19 Feb 2013 16:21:36 +0000 (08:21 -0800)
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>
drivers/infiniband/ulp/ipoib/ipoib_main.c

index 4fe44eba2f9fcb8cf638e274bf36a284585d7e89..66d6da90982f2764e08dc3d0a6895a63049aa92d 100644 (file)
@@ -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);