XArray: Fix xas_find returning too many entries
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Sat, 18 Jan 2020 03:13:21 +0000 (22:13 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jan 2020 15:45:27 +0000 (16:45 +0100)
commitdd05cf12c72f11b7841d4ffeca29e5190606df1b
treebcfbb7292323391acf1e68eee3d8d4f8514bae83
parentdb38561288b75082b5e839decaa15ed253bd2298
XArray: Fix xas_find returning too many entries

commit c44aa5e8ab58b5f4cf473970ec784c3333496a2e upstream.

If you call xas_find() with the initial index > max, it should have
returned NULL but was returning the entry at index.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lib/test_xarray.c
lib/xarray.c