Skip to content

Commit 50e36be

Browse files
Aymeric Agon-Rambossontorvalds
authored andcommitted
scripts/gdb: repair rb_first() and rb_last()
The current implementations of the rb_first() and rb_last() gdb functions have a variable that references itself in its instanciation, which causes the function to throw an error if a specific condition on the argument is met. The original author rather intended to reference the argument and made a typo. Referring the argument instead makes the function work as intended. Signed-off-by: Aymeric Agon-Rambosson <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Cc: Jan Kiszka <[email protected]> Cc: Kieran Bingham <[email protected]> Cc: Douglas Anderson <[email protected]> Cc: Nikolay Borisov <[email protected]> Cc: Jackie Liu <[email protected]> Cc: Jason Wessel <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent 0c54a6a commit 50e36be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/gdb/linux/rbtree.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
def rb_first(root):
1414
if root.type == rb_root_type.get_type():
15-
node = node.address.cast(rb_root_type.get_type().pointer())
15+
node = root.address.cast(rb_root_type.get_type().pointer())
1616
elif root.type != rb_root_type.get_type().pointer():
1717
raise gdb.GdbError("Must be struct rb_root not {}".format(root.type))
1818

@@ -28,7 +28,7 @@ def rb_first(root):
2828

2929
def rb_last(root):
3030
if root.type == rb_root_type.get_type():
31-
node = node.address.cast(rb_root_type.get_type().pointer())
31+
node = root.address.cast(rb_root_type.get_type().pointer())
3232
elif root.type != rb_root_type.get_type().pointer():
3333
raise gdb.GdbError("Must be struct rb_root not {}".format(root.type))
3434

0 commit comments

Comments
 (0)