release module on error in init_driver()

free devices pointer in uninit_driver()


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22241 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2007-09-18 19:17:13 +00:00
parent 575d819a54
commit 15f309e265

View File

@ -991,8 +991,10 @@ init_driver()
devices_count++;
}
if (devices_count <= 0)
if (devices_count <= 0) {
put_module(FIREWIRE_MODULE_NAME);
return ENODEV;
}
devices = malloc(sizeof(char *) * (devices_count+1));
for (i=0; i<devices_count; i++) {
@ -1013,6 +1015,7 @@ uninit_driver()
for (i=0; i<devices_count; i++) {
free(devices[i]);
}
free(devices);
put_module(FIREWIRE_MODULE_NAME);
}