Skip to content

Commit 02ebbd1

Browse files
Aymeric Agon-Rambossongregkh
authored andcommitted
scripts/gdb: repair rb_first() and rb_last()
[ Upstream commit 50e36be ] 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 <aymeric.agon@yandex.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Cc: Jan Kiszka <jan.kiszka@siemens.com> Cc: Kieran Bingham <kbingham@kernel.org> Cc: Douglas Anderson <dianders@chromium.org> Cc: Nikolay Borisov <n.borisov.lkml@gmail.com> Cc: Jackie Liu <liuyun01@kylinos.cn> Cc: Jason Wessel <jason.wessel@windriver.com> Link: http://lkml.kernel.org/r/20200427051029.354840-1-aymeric.agon@yandex.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 9eff404 commit 02ebbd1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎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)