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,8 +251,9 @@ int bch2_hash_set(struct btree_trans *trans, ...@@ -251,8 +251,9 @@ int bch2_hash_set(struct btree_trans *trans,
if (!ret) if (!ret)
ret = -ENOSPC; ret = -ENOSPC;
out: out:
if (slot) if (!IS_ERR_OR_NULL(slot))
bch2_trans_iter_put(trans, slot); bch2_trans_iter_put(trans, slot);
if (!IS_ERR_OR_NULL(iter))
bch2_trans_iter_put(trans, iter); bch2_trans_iter_put(trans, iter);
return ret; return ret;
......
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