From 9a18e1d269f663f5cc0d3fb62d2c286888c42e88 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Fri, 30 May 2008 20:30:07 +0000 Subject: [PATCH] * Do not delete the device handed over to the devfs when deleting the vnode as it seems devfs should not take over ownership. The device is deleted in republish_driver for legacy drivers before the call to devfs_unpublish_device that in turn deletes the vnode. This looks generally suspicious to me as the device pointer the devfs vnode may still use gets invalid for a certain amount of time (until the node is unpublished). So maybe the devfs should take ownership of the device afterall and it shouldn't be deleted by the device_manager/legacy driver functions. Axel please review. * Do not try to delete the IOScheduler for now as creating one is disabled currently too. This fixes the crash on rescans of legacy drivers as seen when unplugging USB devices. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25729 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/device_manager/devfs.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/system/kernel/device_manager/devfs.cpp b/src/system/kernel/device_manager/devfs.cpp index 79486ac87f..a46bf65034 100644 --- a/src/system/kernel/device_manager/devfs.cpp +++ b/src/system/kernel/device_manager/devfs.cpp @@ -255,8 +255,9 @@ devfs_delete_vnode(struct devfs* fs, struct devfs_vnode* vnode, put_vnode(fs->volume, vnode->stream.u.dev.partition->raw_device->id); } else { +#if 0 delete vnode->stream.u.dev.scheduler; - delete vnode->stream.u.dev.device; +#endif } }