Changeset 45a9cf4 in mainline for uspace/drv/bus/usb/ohci/pci.c


Ignore:
Timestamp:
2011-09-17T21:53:30Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
086290d, c5808b41, f1d6866
Parents:
dfa48b0d
Message:

uhci,ohci: Fix memory leak.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ohci/pci.c

    rdfa48b0d r45a9cf4  
    7070        if (!parent_sess)
    7171                return ENOMEM;
    72        
     72
    7373        hw_resource_list_t hw_resources;
    7474        int rc = hw_res_get_resource_list(parent_sess, &hw_resources);
     75        async_hangup(parent_sess);
    7576        if (rc != EOK) {
    76                 async_hangup(parent_sess);
    7777                return rc;
    7878        }
    79        
     79
    8080        uintptr_t mem_address = 0;
    8181        size_t mem_size = 0;
    8282        bool mem_found = false;
    83        
     83
    8484        int irq = 0;
    8585        bool irq_found = false;
    86        
     86
    8787        size_t i;
    8888        for (i = 0; i < hw_resources.count; i++) {
     
    107107                }
    108108        }
    109        
     109        free(hw_resources.resources);
     110
    110111        if (mem_found && irq_found) {
    111112                *mem_reg_address = mem_address;
    112113                *mem_reg_size = mem_size;
    113114                *irq_no = irq;
    114                 rc = EOK;
    115         } else
    116                 rc = ENOENT;
    117        
    118         async_hangup(parent_sess);
    119         return rc;
     115                return EOK;
     116        }
     117        return ENOENT;
    120118}
    121119
Note: See TracChangeset for help on using the changeset viewer.