rwi = get_next_rwi(adapter);
 
                /*
-                * If there is another reset queued, free the previous rwi
-                * and process the new reset even if previous reset failed
-                * (the previous reset could have failed because of a fail
-                * over for instance, so process the fail over).
-                *
                 * If there are no resets queued and the previous reset failed,
                 * the adapter would be in an undefined state. So retry the
                 * previous reset as a hard reset.
+                *
+                * Else, free the previous rwi and, if there is another reset
+                * queued, process the new reset even if previous reset failed
+                * (the previous reset could have failed because of a fail
+                * over for instance, so process the fail over).
                 */
-               if (rwi)
-                       kfree(tmprwi);
-               else if (rc)
+               if (!rwi && rc)
                        rwi = tmprwi;
+               else
+                       kfree(tmprwi);
 
                if (rwi && (rwi->reset_reason == VNIC_RESET_FAILOVER ||
                            rwi->reset_reason == VNIC_RESET_MOBILITY || rc))