In case of error from e1e_rphy(), the loop will exit early and "success"
will be set to true erroneously.
Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
        s32 ret_val = 0;
        u16 i, phy_status;
 
+       *success = false;
        for (i = 0; i < iterations; i++) {
                /* Some PHYs require the MII_BMSR register to be read
                 * twice due to the link bit being sticky.  No harm doing
                ret_val = e1e_rphy(hw, MII_BMSR, &phy_status);
                if (ret_val)
                        break;
-               if (phy_status & BMSR_LSTATUS)
+               if (phy_status & BMSR_LSTATUS) {
+                       *success = true;
                        break;
+               }
                if (usec_interval >= 1000)
                        msleep(usec_interval / 1000);
                else
                        udelay(usec_interval);
        }
 
-       *success = (i < iterations);
-
        return ret_val;
 }