Re: [PATCH] mm/hmm/test: Fix an error code in dmirror_allocate_chunk()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 10/10/20 1:08 PM, Dan Carpenter wrote:
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 <dan.carpenter@xxxxxxxxxx>
---
I messed this up earlier...  My devel version of Smatch prints too much
garbage so I missed the warning when I first wrote the patch.  :/
Sorry.

  lib/test_hmm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/test_hmm.c b/lib/test_hmm.c
index e151a7f10519..80a78877bd93 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");

Thanks for fixing this.
Reviewed-by: Ralph Campbell <rcampbell@xxxxxxxxxx>



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux