From: Eric Dumazet Date: Fri, 9 Apr 2010 23:47:31 +0000 (+0000) Subject: can: avoids a false warning X-Git-Tag: MMI-PSA29.97-13-9~23985^2~83 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4ffa87012efd7b664762b579213d4663560ef4a3;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git can: avoids a false warning At this point optlen == sizeof(sfilter) but some compilers are dumb. Reported-by: Németh Márton Acked-by: Oliver Hartkopp Signed-off-by: David S. Miller --- diff --git a/net/can/raw.c b/net/can/raw.c index 3a7dffb6519c..da99cf153b33 100644 --- a/net/can/raw.c +++ b/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; }