Changeset 40be7eb in mainline


Ignore:
Timestamp:
2024-12-30T23:07:56Z (5 months ago)
Author:
Miroslav Cimerman <mc@…>
Children:
bc3d695
Parents:
7d25273
Message:

lib/device/src/hr.c: session init style

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/device/src/hr.c

    r7d25273 r40be7eb  
    4747{
    4848        errno_t rc;
    49 
    50         hr_t *hr = calloc(1, sizeof(hr_t));
     49        hr_t *hr = NULL;
     50
     51        if (rhr == NULL)
     52                return EINVAL;
     53
     54        hr = calloc(1, sizeof(hr_t));
    5155        if (hr == NULL) {
    5256                rc = ENOMEM;
     
    5761
    5862        rc = loc_service_get_id(SERVICE_NAME_HR, &hr_svcid, 0);
    59         if (rc != EOK) {
    60                 rc = EIO;
    61                 goto error;
    62         }
     63        if (rc != EOK)
     64                goto error;
    6365
    6466        hr->sess = loc_service_connect(hr_svcid, INTERFACE_HR, 0);
     
    7375        if (hr != NULL)
    7476                free(hr);
    75         *rhr = NULL;
     77
    7678        return rc;
    7779}
Note: See TracChangeset for help on using the changeset viewer.