I don't think this can be abused in this case but do things properly.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
sprintf(name, "cf%s", tty->name);
dev = alloc_netdev(sizeof(*ser), name, caifdev_setup);
ser = netdev_priv(dev);
- ser->tty = tty;
+ ser->tty = tty_kref_get(tty);
ser->dev = dev;
debugfs_init(ser, tty);
tty->receive_room = N_TTY_BUF_SIZE;
unregister_netdevice(ser->dev);
list_del(&ser->node);
debugfs_deinit(ser);
+ tty_kref_put(ser->tty);
if (!islocked)
rtnl_unlock();
}