Fix dereference after free. CID 10543.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39909 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -737,8 +737,9 @@ usb_disk_device_added(usb_device newDevice, void **cookie)
|
|||||||
device->notify = create_sem(0, "usb_disk callback notify");
|
device->notify = create_sem(0, "usb_disk callback notify");
|
||||||
if (device->notify < B_OK) {
|
if (device->notify < B_OK) {
|
||||||
mutex_destroy(&device->lock);
|
mutex_destroy(&device->lock);
|
||||||
|
status_t result = device->notify;
|
||||||
free(device);
|
free(device);
|
||||||
return device->notify;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
device->lun_count = usb_disk_get_max_lun(device) + 1;
|
device->lun_count = usb_disk_get_max_lun(device) + 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user