forked from luck/tmp_suning_uos_patched
mkiss: Fix use after free in mkiss_close().
Need to do the unregister_device() after all references to the driver private have been done. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
acf673a318
commit
d79f16c046
@ -798,13 +798,13 @@ static void mkiss_close(struct tty_struct *tty)
|
||||
if (!atomic_dec_and_test(&ax->refcnt))
|
||||
down(&ax->dead_sem);
|
||||
|
||||
unregister_netdev(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. */
|
||||
|
Loading…
Reference in New Issue
Block a user