Commit a6cd6fd7 authored by Alessandro Rubini's avatar Alessandro Rubini

kernel/nic: increment module use while sleeping

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 00f12b55
......@@ -255,11 +255,14 @@ again:
ch--; c--; /* The for above incremeted them */
/*
* HACK: since 2.1.68 (Nov 1997) the ioctl is called locked.
* So we need to unlock, but that is dangerous for rmmod
* So we need to unlock, but that is dangerous for rmmod.
* Let's thus increase the module usage while sleeping
*/
try_module_get(THIS_MODULE);
rtnl_unlock();
wait_event_interruptible(c->q, c->bhead != c->btail);
rtnl_lock();
module_put(THIS_MODULE);
if (signal_pending(current))
return -ERESTARTSYS;
goto again;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment