Skip to content

Commit

Permalink
[AX25] mkiss: Drop spinlock before sleeping call.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ralf Baechle authored and David S. Miller committed Jan 9, 2006
1 parent 09a6266 commit c1854eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/hamradio/mkiss.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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. */
Expand Down

0 comments on commit c1854eb

Please sign in to comment.