From: Dan Carpenter <dan.carpenter@oracle.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
netdev@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
RUC_Soft_Sec <zy900702@163.com>
Subject: [patch] hamradio/kiss: missing error code in mkiss_open()
Date: Tue, 11 Aug 2015 00:39:22 +0300 [thread overview]
Message-ID: <20150810213922.GA3380@mwanda> (raw)
In-Reply-To: <CA+55aFy1af43uxH1r=_CxTCgPNN802YA+H26Vbbkb=rknqZuXQ@mail.gmail.com>
If register_netdev() fails we return success but we should return an
error code instead.
Reported-by: RUC_Soft_Sec <zy900702@163.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
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 */
next prev parent reply other threads:[~2015-08-10 21:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-10 16:42 [FWD] PROBLEM: there exists a wrong return value of function mkiss_open() Linus Torvalds
2015-08-10 21:39 ` Dan Carpenter [this message]
2015-08-11 0:32 ` [patch] hamradio/kiss: missing error code in mkiss_open() Fabio Estevam
2015-08-11 4:19 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150810213922.GA3380@mwanda \
--to=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=ebiederm@xmission.com \
--cc=netdev@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=zy900702@163.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.