mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
XArray: Fix xa_erase of 2-byte aligned entries
xas_store() was interpreting the entry it found in the array as a node entry if the bottom two bits had value 2. That's only true if either the entry is in the root node or in a non-leaf node. Signed-off-by: Matthew Wilcox <willy@infradead.org>
This commit is contained in:
@@ -800,7 +800,7 @@ void *xas_store(struct xa_state *xas, void *entry)
|
||||
* entry is set to NULL.
|
||||
*/
|
||||
rcu_assign_pointer(*slot, entry);
|
||||
if (xa_is_node(next))
|
||||
if (xa_is_node(next) && (!node || node->shift))
|
||||
xas_free_nodes(xas, xa_to_node(next));
|
||||
if (!node)
|
||||
break;
|
||||
|
Reference in New Issue
Block a user