diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-10-04 21:38:41 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:08:28 +0300 |
commit | d65a8551c822030e1214bcffbcb181d4878414b5 (patch) | |
tree | 0b6c36f02f37fb26381ac5d6d42728a7747b9701 /fs/bcachefs | |
parent | 58677a1d40df8fe3375e9badd7387cf1a2946a3a (diff) | |
download | linux-d65a8551c822030e1214bcffbcb181d4878414b5.tar.xz |
bcachefs: Fix deref of error pointer
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs')
-rw-r--r-- | fs/bcachefs/str_hash.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/bcachefs/str_hash.h b/fs/bcachefs/str_hash.h index 31e55acbbead..a81fc3596fc1 100644 --- a/fs/bcachefs/str_hash.h +++ b/fs/bcachefs/str_hash.h @@ -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: |