Subject: [patch] hamradio/kiss: missing error code in mkiss_open()

From: Dan Carpenter <[email-masked]>
Date: Tue, 11 Aug 2015 00:39:22 +0300

If register_netdev() fails we return success but we should return an
error code instead.

Reported-by: RUC_Soft_Sec <[email-masked]>
Signed-off-by: Dan Carpenter <[email-masked]>

diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c
index 2ffbf13..dcb6bb7 100644
--- a/drivers/net/hamradio/mkiss.c
+++ b/drivers/net/hamradio/mkiss.c
@@ -732,7 +732,8 @@ static int mkiss_open(struct tty_struct *tty)
 		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 */