if (len == 0)
return addr;
len = PAGE_ALIGN(len);
if (len > TASK_SIZE || len == 0)
return -EINVAL;
That should cover all cases and not make the TASK_SIZE assumption.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/