]> err.no Git - linux-2.6/commitdiff
[AX25] mkiss: Drop spinlock before sleeping call.
authorRalf Baechle <ralf@linux-mips.org>
Mon, 9 Jan 2006 06:31:04 +0000 (22:31 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 9 Jan 2006 22:16:21 +0000 (14:16 -0800)
With the previous missing-unlock fix the spinlock is dropped only
after the tty->driver->write() call which might sleep.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hamradio/mkiss.c

index 41b3d83c2ab83d7e9a6a7da72586b3d147824c3e..f4424cf886c563a3a5c4955336f7c3c2c8f52f04 100644 (file)
@@ -515,6 +515,7 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len)
                        count = kiss_esc(p, (unsigned char *)ax->xbuff, len);
                }
        }
+       spin_unlock_bh(&ax->buflock);
 
        set_bit(TTY_DO_WRITE_WAKEUP, &ax->tty->flags);
        actual = ax->tty->driver->write(ax->tty, ax->xbuff, count);
@@ -524,7 +525,6 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len)
        ax->dev->trans_start = jiffies;
        ax->xleft = count - actual;
        ax->xhead = ax->xbuff + actual;
-       spin_unlock_bh(&ax->buflock);
 }
 
 /* Encapsulate an AX.25 packet and kick it into a TTY queue. */