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

Changeset 562a48b in mainline for uspace/lib/drv/generic/driver.c


Ignore:
Timestamp:
2016-03-16T10:21:23Z (5 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
master
Children:
479cc46
Parents:
722bb5a
git-author:
Manuele Conti <conti.manuele@…> (2016-03-16 10:21:23)
git-committer:
Jakub Jermar <jakub@…> (2016-03-16 10:21:23)
Message:

Fix a memory leak in error path in driver_dev_add().

File:
1 edited

Legend:

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

    r722bb5a r562a48b  
    121121        devman_handle_t parent_fun_handle = IPC_GET_ARG2(*icall);
    122122       
    123         ddf_dev_t *dev = create_device();
    124        
    125         /* Add one reference that will be dropped by driver_dev_remove() */
    126         dev_add_ref(dev);
    127         dev->handle = dev_handle;
    128        
    129123        char *dev_name = NULL;
    130124        int rc = async_data_write_accept((void **) &dev_name, true, 0, 0, 0, 0);
     
    133127                return;
    134128        }
    135        
     129
     130        ddf_dev_t *dev = create_device();
     131
     132        /* Add one reference that will be dropped by driver_dev_remove() */
     133        dev_add_ref(dev);
     134        dev->handle = dev_handle;
    136135        dev->name = dev_name;
    137136       
Note: See TracChangeset for help on using the changeset viewer.