If usbatm_do_heavy_init finishes before usbatm_heavy_init
writes the pid, the disconnect method could shoot down the
wrong process if the pid has been recycled.
Signed-off-by: Duncan Sands <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
daemonize(instance->driver->driver_name);
allow_signal(SIGTERM);
+ instance->thread_pid = get_current()->pid;
complete(&instance->thread_started);
return ret;
}
- mutex_lock(&instance->serialize);
- instance->thread_pid = ret;
- mutex_unlock(&instance->serialize);
-
wait_for_completion(&instance->thread_started);
return 0;