NET: phy_device, fix lock imbalance
authorJiri Slaby <jirislaby@gmail.com>
Mon, 13 Jul 2009 11:23:39 +0000 (11:23 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Jul 2009 19:03:39 +0000 (12:03 -0700)
Don't forget to unlock a mutex in phy_scan_fixups on a fail path.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy_device.c

index eba937c463767fd1e07ea2425db0a17165e263ab..b10fedd8214394b591bfb81bd102c8d38fce9fb1 100644 (file)
@@ -134,8 +134,10 @@ int phy_scan_fixups(struct phy_device *phydev)
 
                        err = fixup->run(phydev);
 
-                       if (err < 0)
+                       if (err < 0) {
+                               mutex_unlock(&phy_fixup_lock);
                                return err;
+                       }
                }
        }
        mutex_unlock(&phy_fixup_lock);