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 <tamird@gmail.com>
Reported-by: <syzbot+092bbab7da235a02a03a@syzkaller.appspotmail.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Tamir Duberstein 2024-12-04 10:21:59 -05:00 committed by Andrew Morton
parent 4b67927e9c
commit afdbcfc779

View File

@ -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);