perf: Remove the extra validity check on nr_pages
[linux-2.6-block.git] / kernel / events / core.c
index 7f2fbb8b5069b3258bdd9721c60b850f965953d1..0969c9b67eece9c9096e8521ca2b16f52e4d552e 100644 (file)
@@ -4420,7 +4420,7 @@ static int perf_mmap(struct file *file, struct vm_area_struct *vma)
         * If we have rb pages ensure they're a power-of-two number, so we
         * can do bitmasks instead of modulo.
         */
-       if (nr_pages != 0 && !is_power_of_2(nr_pages))
+       if (!is_power_of_2(nr_pages))
                return -EINVAL;
 
        if (vma_size != PAGE_SIZE * (1 + nr_pages))