The subject line is missing the loop: prefix. This approach looks very reasonable, but a few comments below: > - lo->workqueue = alloc_workqueue("loop%d", > - WQ_UNBOUND | WQ_FREEZABLE, > - 0, > - lo->lo_number); > + if (!lo->workqueue) > + lo->workqueue = alloc_workqueue("loop%d", > + WQ_UNBOUND | WQ_FREEZABLE, > + 0, lo->lo_number); Instead of having to deal with sometimes present workqueues, why not move the workqueue allocation to loop_add? > + /* This is safe: open() is still holding a reference. */ > + module_put(THIS_MODULE); Any reason to move the module_put here insted of keeping it at the end of the function as the old code did?