Fix for race, when sysfs work can be destroyed just after sysfs_work_lock released. Noticed by Bart Van Assche <bvanassche@acm.org>

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3355 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2011-04-04 18:33:14 +00:00
parent ba711072a4
commit 471bbfe6a0

View File

@@ -432,10 +432,10 @@ int scst_sysfs_queue_wait_work(struct scst_sysfs_work_item *work)
active_sysfs_works++;
spin_unlock(&sysfs_work_lock);
kref_get(&work->sysfs_work_kref);
spin_unlock(&sysfs_work_lock);
wake_up(&sysfs_work_waitQ);
while (1) {