From: Dan Carpenter Date: Fri, 16 Oct 2020 03:11:34 +0000 (-0700) Subject: lib/test_hmm.c: fix an error code in dmirror_allocate_chunk() X-Git-Tag: v5.15~2654^2~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f3c9d0a3fe97a8b05548d27e9a8e7a5e6875004c;p=platform%2Fkernel%2Flinux-starfive.git lib/test_hmm.c: fix an error code in dmirror_allocate_chunk() This is supposed to return false on failure, not a negative error code. Fixes: 170e38548b81 ("mm/hmm/test: use after free in dmirror_allocate_chunk()") Signed-off-by: Dan Carpenter Signed-off-by: Andrew Morton Reviewed-by: Ralph Campbell Cc: Jerome Glisse Cc: Stephen Rothwell Cc: Jason Gunthorpe Cc: Dan Williams Link: https://lkml.kernel.org/r/20201010200812.GA1886610@mwanda Signed-off-by: Linus Torvalds --- diff --git a/lib/test_hmm.c b/lib/test_hmm.c index e151a7f..80a7887 100644 --- a/lib/test_hmm.c +++ b/lib/test_hmm.c @@ -461,7 +461,7 @@ static bool dmirror_allocate_chunk(struct dmirror_device *mdevice, devmem = kzalloc(sizeof(*devmem), GFP_KERNEL); if (!devmem) - return -ENOMEM; + return false; res = request_free_mem_region(&iomem_resource, DEVMEM_CHUNK_SIZE, "hmm_dmirror");