> > mmap() returns MAP_FAILED, which is defined as (void *)-1, on error,
> > not NULL.  Several selftests incorrectly check the return value of
> > mmap() using !ptr or ptr == NULL, which would erroneously treat
> > MAP_FAILED as a valid pointer since MAP_FAILED is non-zero and
> > non-NULL.  This can lead to segfaults when mmap() actually fails
> > under memory pressure.
> > 
> > Signed-off-by: Hongfu Li <[email protected]>
> 
> Hopefully you have fixed all instances in selftests/mm :)
> 
> Reviewed-by: Dev Jain <[email protected]>

Thanks a lot for the reminder.
I missed some cases in selftests/mm, will fix all of them and post
v2 shortly.

Thanks again for your review.

Best regards,
Hongfu

Reply via email to