summaryrefslogtreecommitdiff
path: root/fs/bcachefs/str_hash.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-02-18 22:27:10 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:35 +0300
commit8b53852d0a80ec4e438205bf8eb3a5a73ee8238c (patch)
tree32502129e6ea44593c7efddc801e7080a44a5f05 /fs/bcachefs/str_hash.h
parentfdf224003354fb14e20f638e479273c4728dfc0a (diff)
downloadlinux-8b53852d0a80ec4e438205bf8eb3a5a73ee8238c.tar.xz
bcachefs: Make sure we're releasing btree iterators
This wasn't originally required, but this is the model we're moving towards. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/str_hash.h')
-rw-r--r--fs/bcachefs/str_hash.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/bcachefs/str_hash.h b/fs/bcachefs/str_hash.h
index cf6ecd963a7b..0710d0bbe36d 100644
--- a/fs/bcachefs/str_hash.h
+++ b/fs/bcachefs/str_hash.h
@@ -262,10 +262,8 @@ int bch2_hash_set(struct btree_trans *trans,
if (!ret)
ret = -ENOSPC;
out:
- if (!IS_ERR_OR_NULL(slot))
- bch2_trans_iter_put(trans, slot);
- if (!IS_ERR_OR_NULL(iter))
- bch2_trans_iter_put(trans, iter);
+ bch2_trans_iter_put(trans, slot);
+ bch2_trans_iter_put(trans, iter);
return ret;
found: