From 8becc9d8196686c4af74c190949cd4d6de304c33 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Wed, 4 Dec 2024 10:21:59 -0500 Subject: [PATCH] xarray-extract-helper-from-__xa_insertcmpxchg-fix fix __xa_erase() Link: https://lkml.kernel.org/r/CAJ-ks9kN_qddZ3Ne5d=cADu5POC1rHd4rQcbVSD_spnZOrLLZg@mail.gmail.com Signed-off-by: Tamir Duberstein Reported-by: Cc: Jens Axboe Cc: Matthew Wilcox Cc: Pavel Begunkov Signed-off-by: Andrew Morton --- lib/xarray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/xarray.c b/lib/xarray.c index 2af86bede3c1..5da8d18899a1 100644 --- a/lib/xarray.c +++ b/lib/xarray.c @@ -1509,7 +1509,7 @@ static void *xas_result(struct xa_state *xas, void *curr) void *__xa_erase(struct xarray *xa, unsigned long index) { XA_STATE(xas, xa, index); - return xas_result(&xas, xas_store(&xas, NULL)); + return xas_result(&xas, xa_zero_to_null(xas_store(&xas, NULL))); } EXPORT_SYMBOL(__xa_erase);