summaryrefslogtreecommitdiff
path: root/lib/xarray.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2020-01-31 06:17:09 -0500
committerMatthew Wilcox (Oracle) <willy@infradead.org>2020-01-31 15:09:49 -0500
commitc36d451ad386b34f452fc3c8621ff14b9eaa31a6 (patch)
treea62a6a6a3af528e6cfc91f686d37d8148a620c9d /lib/xarray.c
parentbd40b17ca49d7d110adf456e647701ce74de2241 (diff)
XArray: Fix xas_pause for large multi-index entries
Inspired by the recent Coverity report, I looked for other places where the offset wasn't being converted to an unsigned long before being shifted, and I found one in xas_pause() when the entry being paused is of order >32. Fixes: b803b42823d0 ("xarray: Add XArray iterators") Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: stable@vger.kernel.org
Diffstat (limited to 'lib/xarray.c')
-rw-r--r--lib/xarray.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/xarray.c b/lib/xarray.c
index acd1fad2e862..05324cf571f4 100644
--- a/lib/xarray.c
+++ b/lib/xarray.c
@@ -970,7 +970,7 @@ void xas_pause(struct xa_state *xas)
xas->xa_node = XAS_RESTART;
if (node) {
- unsigned int offset = xas->xa_offset;
+ unsigned long offset = xas->xa_offset;
while (++offset < XA_CHUNK_SIZE) {
if (!xa_is_sibling(xa_entry(xas->xa, node, offset)))
break;