Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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.

Link: https://lkml.kernel.org/r/4ae23bb1-c333-f669-da2d-fa35c4f49018@amazon.com
Signed-off-by: George Prekas <prekageo@amazon.com>
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Kieran Bingham <kbingham@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

George Prekas and committed by
Linus Torvalds
db7fbf49 3d2fc4c0

+5
+5
scripts/gdb/linux/lists.py
··· 27 27 raise TypeError("Must be struct list_head not {}" 28 28 .format(head.type)) 29 29 30 + if head['next'] == 0: 31 + gdb.write("list_for_each: Uninitialized list '{}' treated as empty\n" 32 + .format(head.address)) 33 + return 34 + 30 35 node = head['next'].dereference() 31 36 while node.address != head.address: 32 37 yield node.address