diff options
Diffstat (limited to 'net/sunrpc/cache.c')
-rw-r--r-- | net/sunrpc/cache.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index 465df9ae1046..8c6598e0334a 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c | |||
@@ -828,6 +828,8 @@ static ssize_t cache_do_downcall(char *kaddr, const char __user *buf, | |||
828 | { | 828 | { |
829 | ssize_t ret; | 829 | ssize_t ret; |
830 | 830 | ||
831 | if (count == 0) | ||
832 | return -EINVAL; | ||
831 | if (copy_from_user(kaddr, buf, count)) | 833 | if (copy_from_user(kaddr, buf, count)) |
832 | return -EFAULT; | 834 | return -EFAULT; |
833 | kaddr[count] = '\0'; | 835 | kaddr[count] = '\0'; |