Skip to content

Commit

Permalink
l2tp: fix set but not used variable
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jakub Kicinski authored and David S. Miller committed Apr 19, 2019
1 parent 0bc1998 commit 503c018
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/l2tp/l2tp_ppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;

Expand Down

0 comments on commit 503c018

Please sign in to comment.