]> git.hungrycats.org Git - linux/commitdiff
[IRDA]: Fix error return status in stir4200 driver.
authorFrançois Romieu <romieu@fr.zoreil.com>
Sat, 14 Feb 2004 04:41:16 +0000 (20:41 -0800)
committerDavid S. Miller <davem@nuts.davemloft.net>
Sat, 14 Feb 2004 04:41:16 +0000 (20:41 -0800)
If stir_reset() succeeds, stir_net_open() must not return a
success status code for every failure until irlap_open().

drivers/net/irda/stir4200.c

index 2a7e865b4624a54d076025997917a98398c0e660..d7bb8a6ac873f40fb3beac3e33f57049935220b7 100644 (file)
@@ -913,6 +913,8 @@ static int stir_net_open(struct net_device *netdev)
        if (err)
                goto err_out1;
 
+       err = -ENOMEM;
+
        /* Note: Max SIR frame possible is 4273 */
        stir->tx_data = kmalloc(STIR_FIFO_SIZE, GFP_KERNEL);
        if (!stir->tx_data) {
@@ -956,7 +958,6 @@ static int stir_net_open(struct net_device *netdev)
         * Note : will send immediately a speed change...
         */
        sprintf(hwname, "usb#%d", stir->usbdev->devnum);
-       err = -ENOMEM;
        stir->irlap = irlap_open(netdev, &stir->qos, hwname);
        if (!stir->irlap) {
                ERROR("%s(): irlap_open failed\n", __FUNCTION__);