Changeset fb422312 in mainline for uspace/lib/usbdev/src/hub.c


Ignore:
Timestamp:
2011-10-13T11:42:31Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
eda7a4e0
Parents:
612af1a0
Message:

libusbdev: Warn about not closing hc connections.

There is not much we can do.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/src/hub.c

    r612af1a0 rfb422312  
    3737#include <usb/dev/request.h>
    3838#include <usb/dev/recognise.h>
     39#include <usb/debug.h>
    3940#include <usbhc_iface.h>
    4041#include <errno.h>
     
    220221        usb_address_t dev_addr = usb_hc_request_address(&hc_conn, dev_speed);
    221222        if (dev_addr < 0) {
    222                 usb_hc_connection_close(&hc_conn);
    223                 return EADDRNOTAVAIL;
     223                rc = EADDRNOTAVAIL;
     224                goto close_connection;
    224225        }
    225226
     
    336337                goto leave_release_free_address;
    337338        }
    338        
    339         usb_hc_connection_close(&hc_conn);
     339
    340340
    341341        /*
     
    349349        }
    350350
    351         return EOK;
    352 
    353 
     351        rc = EOK;
     352        goto close_connection;
    354353
    355354        /*
     
    363362        usb_hc_unregister_device(&hc_conn, dev_addr);
    364363
    365         usb_hc_connection_close(&hc_conn);
     364close_connection:
     365        if (usb_hc_connection_close(&hc_conn) != EOK)
     366                usb_log_warning("usb_hc_new_device_wrapper(): Failed to close "
     367                    "connection.\n");
    366368
    367369        return rc;
Note: See TracChangeset for help on using the changeset viewer.