Skip to content

Commit

Permalink
can: avoids a false warning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Apr 13, 2010
1 parent dac8761 commit 4ffa870
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/can/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4ffa870

Please sign in to comment.