diff options
Diffstat (limited to 'kernel/drivers/net/hamradio/mkiss.c')
-rw-r--r-- | kernel/drivers/net/hamradio/mkiss.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/kernel/drivers/net/hamradio/mkiss.c b/kernel/drivers/net/hamradio/mkiss.c index 2ffbf1347..85828f153 100644 --- a/kernel/drivers/net/hamradio/mkiss.c +++ b/kernel/drivers/net/hamradio/mkiss.c @@ -728,11 +728,12 @@ static int mkiss_open(struct tty_struct *tty) dev->type = ARPHRD_AX25; /* Perform the low-level AX25 initialization. */ - if ((err = ax_open(ax->dev))) { + err = ax_open(ax->dev); + if (err) goto out_free_netdev; - } - if (register_netdev(dev)) + err = register_netdev(dev); + if (err) goto out_free_buffers; /* after register_netdev() - because else printk smashes the kernel */ @@ -796,14 +797,19 @@ static void mkiss_close(struct tty_struct *tty) */ if (!atomic_dec_and_test(&ax->refcnt)) down(&ax->dead_sem); - - unregister_netdev(ax->dev); + /* + * Halt the transmit queue so that a new transmit cannot scribble + * on our buffers + */ + netif_stop_queue(ax->dev); /* Free all AX25 frame buffers. */ kfree(ax->rbuff); kfree(ax->xbuff); ax->tty = NULL; + + unregister_netdev(ax->dev); } /* Perform I/O control on an active ax25 channel. */ |