Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 1fe2c67

Browse files
jeffmahoneyrandomhydrosol
authored andcommitted
reiserfs: fix "new_insert_key may be used uninitialized ..."
commit 0a11b9a upstream. new_insert_key only makes any sense when it's associated with a new_insert_ptr, which is initialized to NULL and changed to a buffer_head when we also initialize new_insert_key. We can key off of that to avoid the uninitialized warning. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Jeff Mahoney <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Jan Kara <[email protected]> Cc: Linus Torvalds <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Willy Tarreau <[email protected]>
1 parent a9dd340 commit 1fe2c67

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/reiserfs/ibalance.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1082,8 +1082,9 @@ int balance_internal(struct tree_balance *tb, /* tree_balance structure
10821082
insert_ptr);
10831083
}
10841084

1085-
memcpy(new_insert_key_addr, &new_insert_key, KEY_SIZE);
10861085
insert_ptr[0] = new_insert_ptr;
1086+
if (new_insert_ptr)
1087+
memcpy(new_insert_key_addr, &new_insert_key, KEY_SIZE);
10871088

10881089
return order;
10891090
}

0 commit comments

Comments
 (0)