[PATCH] [suggestion] mm/gup: avoid IS_ERR_OR_NULL

Jason Gunthorpe jgg at nvidia.com
Sat May 27 02:52:01 PDT 2023


On Sat, May 20, 2023 at 10:12:40AM +0100, Lorenzo Stoakes wrote:
> > No, this returning 0 on failure is a foot gun. Failing to pin a single
> > page is always an error, the only question is what sub reason caused
> > the error to happen. There is no third case where it is not an error.
> 
> The uprobe path thinks otherwise, but maybe the answer is that we just need
> to -EFAULT on missing VMA and -EPERM on invalid flags.

I think uprobe is just broken to think there is a third outcome. Let's
just fix it instead of trying to pretend it makes sense.

Jason



More information about the linux-arm-kernel mailing list