diff options
| author | Ralf Baechle <ralf@linux-mips.org> | 2013-05-08 01:27:46 +0200 |
|---|---|---|
| committer | Ralf Baechle <ralf@linux-mips.org> | 2013-05-08 01:27:46 +0200 |
| commit | 9b3539e0e545e4c2f338acfc1ce52033a6f5e7f7 (patch) | |
| tree | 5c56e4a208dbe7e985e59911e1a421a7c1ee024c /drivers/net/netconsole.c | |
| parent | 3d39019a1655d195a60a86ebf38f9da30bd83d03 (diff) | |
| parent | 1cd1c049271233deccfcc75123afa7f39a607f5a (diff) | |
| download | olio-linux-3.10-9b3539e0e545e4c2f338acfc1ce52033a6f5e7f7.tar.xz olio-linux-3.10-9b3539e0e545e4c2f338acfc1ce52033a6f5e7f7.zip | |
Merge branch 'mips-next-3.10' of git://git.linux-mips.org/pub/scm/john/linux-john into mips-for-linux-next
Diffstat (limited to 'drivers/net/netconsole.c')
| -rw-r--r-- | drivers/net/netconsole.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 37add21a3d7..59ac143dec2 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -666,6 +666,7 @@ static int netconsole_netdev_event(struct notifier_block *this, goto done; spin_lock_irqsave(&target_list_lock, flags); +restart: list_for_each_entry(nt, &target_list, list) { netconsole_target_get(nt); if (nt->np.dev == dev) { @@ -678,15 +679,17 @@ static int netconsole_netdev_event(struct notifier_block *this, case NETDEV_UNREGISTER: /* * rtnl_lock already held + * we might sleep in __netpoll_cleanup() */ - if (nt->np.dev) { - __netpoll_cleanup(&nt->np); - dev_put(nt->np.dev); - nt->np.dev = NULL; - } + spin_unlock_irqrestore(&target_list_lock, flags); + __netpoll_cleanup(&nt->np); + spin_lock_irqsave(&target_list_lock, flags); + dev_put(nt->np.dev); + nt->np.dev = NULL; nt->enabled = 0; stopped = true; - break; + netconsole_target_put(nt); + goto restart; } } netconsole_target_put(nt); |