can: avoids a false warning

At this point optlen == sizeof(sfilter) but some compilers are dumb.

Reported-by: Németh Márton <nm127@freemail.h
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
master
Eric Dumazet 13 years ago committed by David S. Miller
parent dac876193c
commit 4ffa87012e
  1. 2
      net/can/raw.c

@ -445,7 +445,7 @@ static int raw_setsockopt(struct socket *sock, int level, int optname,
return -EFAULT;
}
} else if (count == 1) {
if (copy_from_user(&sfilter, optval, optlen))
if (copy_from_user(&sfilter, optval, sizeof(sfilter)))
return -EFAULT;
}

Loading…
Cancel
Save