diff options
Diffstat (limited to 'net/can')
-rw-r--r-- | net/can/raw.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/can/raw.c b/net/can/raw.c index ead50c7c0d40..201cbfc6b9ec 100644 --- a/net/can/raw.c +++ b/net/can/raw.c | |||
@@ -573,7 +573,8 @@ static int raw_getsockopt(struct socket *sock, int level, int optname, | |||
573 | int fsize = ro->count * sizeof(struct can_filter); | 573 | int fsize = ro->count * sizeof(struct can_filter); |
574 | if (len > fsize) | 574 | if (len > fsize) |
575 | len = fsize; | 575 | len = fsize; |
576 | err = copy_to_user(optval, ro->filter, len); | 576 | if (copy_to_user(optval, ro->filter, len)) |
577 | err = -EFAULT; | ||
577 | } else | 578 | } else |
578 | len = 0; | 579 | len = 0; |
579 | release_sock(sk); | 580 | release_sock(sk); |