Skip to content

Commit

Permalink
assoc_array: fix the return value in assoc_array_insert_mid_shortcut()
Browse files Browse the repository at this point in the history
Returning the edit variable is redundant because it is dereferenced right
before it is returned.  It would be better to return true.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Roman Smirnov <[email protected]>
Reviewed-by: Sergey Shtylyov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
RSmirnov512 authored and akpm00 committed Mar 12, 2024
1 parent c44f063 commit bea0a58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/assoc_array.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ static bool assoc_array_insert_mid_shortcut(struct assoc_array_edit *edit,
edit->leaf_p = &new_n0->slots[0];

pr_devel("<--%s() = ok [split shortcut]\n", __func__);
return edit;
return true;
}

/**
Expand Down

0 comments on commit bea0a58

Please sign in to comment.