Commit 4ffa8701 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

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: default avatarEric Dumazet <eric.dumazet@gmail.com>
Acked-by: default avatarOliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dac87619
...@@ -445,7 +445,7 @@ static int raw_setsockopt(struct socket *sock, int level, int optname, ...@@ -445,7 +445,7 @@ static int raw_setsockopt(struct socket *sock, int level, int optname,
return -EFAULT; return -EFAULT;
} }
} else if (count == 1) { } else if (count == 1) {
if (copy_from_user(&sfilter, optval, optlen)) if (copy_from_user(&sfilter, optval, sizeof(sfilter)))
return -EFAULT; return -EFAULT;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment