]> www.infradead.org Git - users/willy/xarray.git/commit
mm/hmm: do not set pfns when returning an error code
authorJason Gunthorpe <jgg@mellanox.com>
Fri, 27 Mar 2020 20:00:20 +0000 (17:00 -0300)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 30 Mar 2020 19:58:36 +0000 (16:58 -0300)
commit53bfe17ff88faaadf024956e7cb2b295fae7744b
tree1f55d991863b7e21a138c11c29abf485a4fa560c
parent846babe85efdda49feba5b169668333dcf3edf25
mm/hmm: do not set pfns when returning an error code

Most places that return an error code, like -EFAULT, do not set
HMM_PFN_ERROR, only two places do this.

Resolve this inconsistency by never setting the pfns on an error
exit. This doesn't seem like a worthwhile thing to do anyhow.

If for some reason it becomes important, it makes more sense to directly
return the address of the failing page rather than have the caller scan
for the HMM_PFN_ERROR.

No caller inspects the pnfs output array if hmm_range_fault() fails.

Link: https://lore.kernel.org/r/20200327200021.29372-9-jgg@ziepe.ca
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
mm/hmm.c