Skip to contentSkip to conversation

scripts-gdb-fix-list_for_each.patch removed from -mm tree

merged [email protected] 1 participant 1 message Feb 27, 2021

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: scripts/gdb: fix list_for_each
has been removed from the -mm tree. Its filename was
scripts-gdb-fix-list_for_each.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: George Prekas <[email protected]>
Subject: scripts/gdb: fix list_for_each

If the list is uninitialized (next pointer is NULL), list_for_each gets stuck in an infinite loop. Print a message and treat list as empty.

---

 scripts/gdb/linux/lists.py |    5 +++++
 1 file changed, 5 insertions(+)
scripts/gdb/linux/lists.py renamed from scripts/gdb/linux/lists.py~scripts-gdb-fix-list_for_each +5 -0
@@ -27,6 +27,11 @@ def list_for_each(head):
         raise TypeError("Must be struct list_head not {}"
                            .format(head.type))
 
+    if head['next'] == 0:
+        gdb.write("list_for_each: Uninitialized list '{}' treated as empty\n"
+                     .format(head.address))
+        return
+
     node = head['next'].dereference()
     while node.address != head.address:
         yield node.address

_

Patches currently in -mm which might be from [email protected] are