All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, oss-drivers@netronome.com,
	Jakub Kicinski <jakub.kicinski@netronome.com>,
	Dirk van der Merwe <dirk.vandermerwe@netronome.com>,
	James Chapman <jchapman@katalix.com>
Subject: [PATCH net-next 1/5] l2tp: fix set but not used variable
Date: Wed, 17 Apr 2019 13:51:55 -0700	[thread overview]
Message-ID: <20190417205159.30938-2-jakub.kicinski@netronome.com> (raw)
In-Reply-To: <20190417205159.30938-1-jakub.kicinski@netronome.com>

GCC complains:

net/l2tp/l2tp_ppp.c: In function ‘pppol2tp_ioctl’:
net/l2tp/l2tp_ppp.c:1073:6: warning: variable ‘val’ set but not used [-Wunused-but-set-variable]
  int val;
      ^~~

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
---
CC: James Chapman <jchapman@katalix.com>

 net/l2tp/l2tp_ppp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c
index 04d9946dcdba..f36cae785e82 100644
--- a/net/l2tp/l2tp_ppp.c
+++ b/net/l2tp/l2tp_ppp.c
@@ -1070,7 +1070,6 @@ static int pppol2tp_ioctl(struct socket *sock, unsigned int cmd,
 {
 	struct pppol2tp_ioc_stats stats;
 	struct l2tp_session *session;
-	int val;
 
 	switch (cmd) {
 	case PPPIOCGMRU:
@@ -1097,7 +1096,7 @@ static int pppol2tp_ioctl(struct socket *sock, unsigned int cmd,
 		if (!session->session_id && !session->peer_session_id)
 			return -ENOSYS;
 
-		if (get_user(val, (int __user *)arg))
+		if (!access_ok((int __user *)arg, sizeof(int)))
 			return -EFAULT;
 		break;
 
-- 
2.21.0


  reply	other threads:[~2019-04-17 20:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-17 20:51 [PATCH net-next 0/5] net: some build fixes and other improvements Jakub Kicinski
2019-04-17 20:51 ` Jakub Kicinski [this message]
2019-04-17 20:51 ` [PATCH net-next 2/5] sb1000: fix variable set but not used warnings Jakub Kicinski
2019-04-17 20:51 ` [PATCH net-next 3/5] net/sched: taprio: fix build without 64bit div Jakub Kicinski
2019-04-17 22:32   ` Vinicius Costa Gomes
2019-04-30  0:04   ` Leandro Dorileo
2019-04-17 20:51 ` [PATCH net-next 4/5] net: gemini: remove unnecessary assert Jakub Kicinski
2019-04-17 20:51 ` [PATCH net-next 5/5] net: skb: remove unused asserts Jakub Kicinski
2019-04-19  0:06 ` [PATCH net-next 0/5] net: some build fixes and other improvements David Miller
2019-04-19  0:34   ` Jakub Kicinski
2019-04-19  8:38     ` Guillaume Nault

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=20190417205159.30938-2-jakub.kicinski@netronome.com \
    --to=jakub.kicinski@netronome.com \
    --cc=davem@davemloft.net \
    --cc=dirk.vandermerwe@netronome.com \
    --cc=jchapman@katalix.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.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.