Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ddcde142 authored by Oliver Hartkopp's avatar Oliver Hartkopp Committed by David S. Miller
Browse files

slip: fix spinlock variant



With commit cc9fa74e ("slip/slcan: added locking in wakeup function") a
formerly missing locking was added to slip.c and slcan.c by Andre Naujoks.

Alexander Stein contributed the fix 367525c8 ("can: slcan: Fix spinlock
variant") as the kernel lock debugging advised to use spin_lock_bh() instead
of just using spin_lock().

This fix has to be applied to the same code section in slip.c for the same
reason too.

Signed-off-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent df6d14ce
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -429,13 +429,13 @@ static void slip_write_wakeup(struct tty_struct *tty)
	if (!sl || sl->magic != SLIP_MAGIC || !netif_running(sl->dev))
		return;

	spin_lock(&sl->lock);
	spin_lock_bh(&sl->lock);
	if (sl->xleft <= 0)  {
		/* Now serial buffer is almost free & we can start
		 * transmission of another packet */
		sl->dev->stats.tx_packets++;
		clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
		spin_unlock(&sl->lock);
		spin_unlock_bh(&sl->lock);
		sl_unlock(sl);
		return;
	}
@@ -443,7 +443,7 @@ static void slip_write_wakeup(struct tty_struct *tty)
	actual = tty->ops->write(tty, sl->xhead, sl->xleft);
	sl->xleft -= actual;
	sl->xhead += actual;
	spin_unlock(&sl->lock);
	spin_unlock_bh(&sl->lock);
}

static void sl_tx_timeout(struct net_device *dev)