Ignore:
Timestamp:
2012-01-01T22:27:11Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
948911d
Parents:
2b621cb
Message:

libdrv,usb : Return EBADMEM on invalid pointers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/remote_usbhc.c

    r2b621cb r8afeb04  
    165165{
    166166        if (!exch || !address)
    167                 return EINVAL;
     167                return EBADMEM;
    168168        sysarg_t new_address;
    169169        const int ret = async_req_4_1(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),
     
    178178{
    179179        if (!exch)
    180                 return EINVAL;
     180                return EBADMEM;
    181181        return async_req_3_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),
    182182            IPC_M_USBHC_BIND_ADDRESS, address, handle);
     
    187187{
    188188        if (!exch)
    189                 return EINVAL;
     189                return EBADMEM;
    190190        sysarg_t h;
    191191        const int ret = async_req_2_1(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),
     
    199199{
    200200        if (!exch)
    201                 return EINVAL;
     201                return EBADMEM;
    202202        return async_req_2_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),
    203203            IPC_M_USBHC_RELEASE_ADDRESS, address);
     
    209209{
    210210        if (!exch)
    211                 return EINVAL;
     211                return EBADMEM;
    212212        const usb_target_t target =
    213213            {{ .address = address, .endpoint = endpoint }};
     
    225225{
    226226        if (!exch)
    227                 return EINVAL;
     227                return EBADMEM;
    228228        return async_req_4_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),
    229229            IPC_M_USBHC_UNREGISTER_ENDPOINT, address, endpoint, direction);
     
    234234    size_t *rec_size)
    235235{
     236        if (!exch)
     237                return EBADMEM;
     238
    236239        if (size == 0 && setup == 0)
    237240                return EOK;
    238241
    239         if (!exch)
    240                 return EINVAL;
    241242        const usb_target_t target =
    242243            {{ .address = address, .endpoint = endpoint }};
     
    288289    usb_endpoint_t endpoint, uint64_t setup, const void *data, size_t size)
    289290{
     291        if (!exch)
     292                return EBADMEM;
     293
    290294        if (size == 0 && setup == 0)
    291295                return EOK;
    292296
    293         if (!exch)
    294                 return EINVAL;
    295297        const usb_target_t target =
    296298            {{ .address = address, .endpoint = endpoint }};
Note: See TracChangeset for help on using the changeset viewer.