提交 9d332d92 编写于 作者: F Fabio Estevam 提交者: David S. Miller

mkiss: Fix error handling in mkiss_open()

If register_netdev() fails we are not propagating the error and
we return success because ax_open() succeeded previously.

Fix this by checking the return value of ax_open() and
register_netdev() and propagate the error in case of failure.
Reported-by: NRUC_Soft_Sec <zy900702@163.com>
Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 18255457
......@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册