Commit d65a8551 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix deref of error pointer

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 58677a1d
......@@ -251,9 +251,10 @@ int bch2_hash_set(struct btree_trans *trans,
if (!ret)
ret = -ENOSPC;
out:
if (slot)
if (!IS_ERR_OR_NULL(slot))
bch2_trans_iter_put(trans, slot);
bch2_trans_iter_put(trans, iter);
if (!IS_ERR_OR_NULL(iter))
bch2_trans_iter_put(trans, iter);
return ret;
found:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment