wl12xx: fix error handling in wl12xx_probe()
authorKalle Valo <kalle.valo@nokia.com>
Fri, 12 Jun 2009 11:14:34 +0000 (14:14 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 10 Jul 2009 18:57:42 +0000 (14:57 -0400)
Resources were not freed properly in some cases.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/wl12xx/main.c

index c6a45443971143a57b8f7643fba11b0a28902c3c..6d27cd687672fd446f28fa1e66bee6d8c8849f1d 100644 (file)
@@ -1274,13 +1274,15 @@ static int __devinit wl12xx_probe(struct spi_device *spi)
        wl->set_power = pdata->set_power;
        if (!wl->set_power) {
                wl12xx_error("set power function missing in platform data");
-               return -ENODEV;
+               ret = -ENODEV;
+               goto out_free;
        }
 
        wl->irq = spi->irq;
        if (wl->irq < 0) {
                wl12xx_error("irq missing in platform data");
-               return -ENODEV;
+               ret = -ENODEV;
+               goto out_free;
        }
 
        ret = request_irq(wl->irq, wl12xx_irq, 0, DRIVER_NAME, wl);