diff --git a/kernel/watch_queue.c b/kernel/watch_queue.c index 28ed71d277bd..442bb92212f2 100644 --- a/kernel/watch_queue.c +++ b/kernel/watch_queue.c @@ -332,7 +332,7 @@ long watch_queue_set_filter(struct pipe_inode_info *pipe, filter.__reserved != 0) return -EINVAL; - tf = memdup_user(_filter->filters, filter.nr_filters * sizeof(*tf)); + tf = memdup_array_user(_filter->filters, filter.nr_filters, sizeof(*tf)); if (IS_ERR(tf)) return PTR_ERR(tf);