Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset a5a470c in mainline


Ignore:
Timestamp:
2013-01-07T17:37:32Z (9 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
1c73603
Parents:
c9467b0
Message:

usbhub: Decrease op count on error paths.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbhub/port.c

    rc9467b0 ra5a470c  
    458458        assert(params);
    459459
     460        int ret = EOK;
    460461        usb_hub_dev_t *hub = params->hub;
    461462        usb_hub_port_t *port = params->port;
     
    468469        if (!exch) {
    469470                usb_log_error("Failed to begin bus exchange\n");
    470                 return ENOMEM;
     471                ret = ENOMEM;
     472                goto out;
    471473        }
    472474
    473475        /* Reserve default address */
    474         int ret;
    475476        while ((ret = usb_reserve_default_address(exch, speed)) == ENOENT) {
    476477                async_usleep(1000000);
     
    479480                usb_log_error("Failed to reserve default address: %s\n",
    480481                    str_error(ret));
    481                 async_exchange_end(exch);
    482                 return ret;
     482                goto out;
    483483        }
    484484
     
    489489                if (usb_release_default_address(exch) != EOK)
    490490                        usb_log_warning("Failed to release default address\n");
    491                 async_exchange_end(exch);
    492                 return EIO;
     491                ret = EIO;
     492                goto out;
    493493        }
    494494
     
    508508                        usb_log_warning("Failed to release default address\n");
    509509        }
     510out:
    510511        async_exchange_end(exch);
    511512
Note: See TracChangeset for help on using the changeset viewer.