mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-07 11:10:44 +00:00
scoutfs: fix null pointer deref in get_manifest_refs()
When we're not the server node, 'mani' is NULL, so derefing it in our loop causes a crash. That said, we don't need it anyway - the loop will eventually end when our btree walk (via btree_prev_overlap_or_next()) ends. Signed-off-by: Mark Fasheh <mfasheh@versity.com>
This commit is contained in:
@@ -458,7 +458,6 @@ static int get_manifest_refs(struct super_block *sb,
|
||||
struct scoutfs_key_buf *end,
|
||||
struct list_head *ref_list)
|
||||
{
|
||||
DECLARE_MANIFEST(sb, mani);
|
||||
struct scoutfs_manifest_btree_key *mkey;
|
||||
struct scoutfs_manifest_entry ment;
|
||||
SCOUTFS_BTREE_ITEM_REF(iref);
|
||||
@@ -499,7 +498,7 @@ static int get_manifest_refs(struct super_block *sb,
|
||||
* cached items to their locks.
|
||||
*/
|
||||
mkey_len = init_btree_key(mkey, 1, 0, key);
|
||||
for (i = 1; i < mani->nr_levels; i++) {
|
||||
for (i = 1; ; i++) {
|
||||
mkey->level = i;
|
||||
|
||||
/* XXX should use level counts to skip searches */
|
||||
|
||||
Reference in New Issue
Block a user