Skip to content
Snippets Groups Projects
Commit a6cd6fd7 authored by Alessandro Rubini's avatar Alessandro Rubini
Browse files

kernel/nic: increment module use while sleeping


Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
parent 00f12b55
Branches
Tags
No related merge requests found
...@@ -255,11 +255,14 @@ again: ...@@ -255,11 +255,14 @@ again:
ch--; c--; /* The for above incremeted them */ ch--; c--; /* The for above incremeted them */
/* /*
* HACK: since 2.1.68 (Nov 1997) the ioctl is called locked. * 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(); rtnl_unlock();
wait_event_interruptible(c->q, c->bhead != c->btail); wait_event_interruptible(c->q, c->bhead != c->btail);
rtnl_lock(); rtnl_lock();
module_put(THIS_MODULE);
if (signal_pending(current)) if (signal_pending(current))
return -ERESTARTSYS; return -ERESTARTSYS;
goto again; goto again;
......
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