There's no need to check if split_state() returned an error twice, instead
unify into a single if statement after setting 'prealloc' to NULL, because
on error split_state() frees the 'prealloc' extent state record.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
if (!prealloc)
goto search_again;
err = split_state(tree, state, prealloc, start);
- if (err)
- extent_io_tree_panic(tree, state, "split", err);
-
prealloc = NULL;
- if (err)
+ if (err) {
+ extent_io_tree_panic(tree, state, "split", err);
goto out;
+ }
if (state->end <= end) {
state = clear_state_bit(tree, state, bits, wake, changeset);
goto next;