diff options
author | Arnd Bergmann <arnd@arndb.de> | 2011-07-01 20:30:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-01 20:30:00 -0400 |
commit | 6e4e2f811bade330126d4029c88c831784a7efd9 (patch) | |
tree | 03d365ae386b9a8f43c24483eb0455a73a96bf48 /drivers | |
parent | 60c2ce2b4facf28f569115a55e1f479eb12bd0f1 (diff) |
6pack,mkiss: fix lock inconsistency
Lockdep found a locking inconsistency in the mkiss_close function:
> kernel: [ INFO: inconsistent lock state ]
> kernel: 2.6.39.1 #3
> kernel: ---------------------------------
> kernel: inconsistent {IN-SOFTIRQ-R} -> {SOFTIRQ-ON-W} usage.
> kernel: ax25ipd/2813 [HC0[0]:SC0[0]:HE1:SE1] takes:
> kernel: (disc_data_lock){+++?.-}, at: [<ffffffffa018552b>] mkiss_close+0x1b/0x90 [mkiss]
> kernel: {IN-SOFTIRQ-R} state was registered at:
The message hints that disc_data_lock is aquired with softirqs disabled,
but does not itself disable softirqs, which can in rare circumstances
lead to a deadlock.
The same problem is present in the 6pack driver, this patch fixes both
by using write_lock_bh instead of write_lock.
Reported-by: Bernard F6BVP <f6bvp@free.fr>
Tested-by: Bernard F6BVP <f6bvp@free.fr>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Ralf Baechle<ralf@linux-mips.org>
Cc: stable@kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/hamradio/6pack.c | 4 | ||||
-rw-r--r-- | drivers/net/hamradio/mkiss.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index 3e5d0b6b6516..0d283781bc5e 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c | |||
@@ -692,10 +692,10 @@ static void sixpack_close(struct tty_struct *tty) | |||
692 | { | 692 | { |
693 | struct sixpack *sp; | 693 | struct sixpack *sp; |
694 | 694 | ||
695 | write_lock(&disc_data_lock); | 695 | write_lock_bh(&disc_data_lock); |
696 | sp = tty->disc_data; | 696 | sp = tty->disc_data; |
697 | tty->disc_data = NULL; | 697 | tty->disc_data = NULL; |
698 | write_unlock(&disc_data_lock); | 698 | write_unlock_bh(&disc_data_lock); |
699 | if (!sp) | 699 | if (!sp) |
700 | return; | 700 | return; |
701 | 701 | ||
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c index 4c628393c8b1..bc02968cee16 100644 --- a/drivers/net/hamradio/mkiss.c +++ b/drivers/net/hamradio/mkiss.c | |||
@@ -813,10 +813,10 @@ static void mkiss_close(struct tty_struct *tty) | |||
813 | { | 813 | { |
814 | struct mkiss *ax; | 814 | struct mkiss *ax; |
815 | 815 | ||
816 | write_lock(&disc_data_lock); | 816 | write_lock_bh(&disc_data_lock); |
817 | ax = tty->disc_data; | 817 | ax = tty->disc_data; |
818 | tty->disc_data = NULL; | 818 | tty->disc_data = NULL; |
819 | write_unlock(&disc_data_lock); | 819 | write_unlock_bh(&disc_data_lock); |
820 | 820 | ||
821 | if (!ax) | 821 | if (!ax) |
822 | return; | 822 | return; |