[MLX4] Soft Reset: (bugfix in error flow) handling a case when MLX4_BUS fails during...
[mirror/winof/.git] / hw / mlx4 / kernel / bus / net / catas.c
index 29132a2..e48ecf8 100644 (file)
@@ -285,12 +285,16 @@ int mlx4_reset_execute( struct ib_event_handler *event_handler )
 
        // restart the device
        err = mlx4_restart_one(pdev);
-
-       // recreate interfaces
-       fix_bus_ifc(pdev);
+       if (err) {
+               event.event = IB_EVENT_RESET_FAILED;
+       }
+       else {
+               // recreate interfaces
+               fix_bus_ifc(pdev);
+               event.event = IB_EVENT_RESET_END;
+       }
 
        // notify the clients
-       event.event = IB_EVENT_RESET_END;
        list_for_each_entry_safe(handler, thandler, &tlist, 
                list, struct ib_event_handler, struct ib_event_handler)
        {