diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2023-04-05 15:27:43 -0700 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-04-08 13:50:17 -0700 |
commit | 1a9656058289dd2aa61d48bb97b7d2c458294ad6 (patch) | |
tree | ca0a1e40e12d4857438dda524250ce27579f8ae5 /scripts/gdb | |
parent | 0e0ace5f1d242cbf17c2b0ef23cdc42ad625a15b (diff) | |
download | linux-next-1a9656058289dd2aa61d48bb97b7d2c458294ad6.tar.gz |
scripts-gdb-add-a-radix-tree-parser-v2
guard against a NULL node in the while loop
Link: https://lkml.kernel.org/r/20230405222743.1191674-1-f.fainelli@gmail.com
Signed-off-by: Kieran Bingham <kieran.bingham@linaro.org>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Kieran Bingham <kbingham@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'scripts/gdb')
-rw-r--r-- | scripts/gdb/linux/radixtree.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/gdb/linux/radixtree.py b/scripts/gdb/linux/radixtree.py index 3ca2db7fbbac..074543ac763d 100644 --- a/scripts/gdb/linux/radixtree.py +++ b/scripts/gdb/linux/radixtree.py @@ -58,6 +58,9 @@ def lookup(root, index): offset = (index >> node['shift']) & constants.LX_RADIX_TREE_MAP_MASK slot = node['slots'][offset] + if slot == 0: + return None + node = slot.cast(node.type.pointer()).dereference() if node == 0: return None |