mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: George Prekas <prekageo@amazon.com>,
	Kieran Bingham <kbingham@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] scripts/gdb: fix list_for_each
Date: Tue, 5 Jan 2021 20:08:22 +0100	[thread overview]
Message-ID: <cef588b9-ad70-e840-7cc6-f1896ccfcbbf@siemens.com> (raw)
In-Reply-To: <04baeb3e-4b46-ae3a-b4e1-4663d1510b05@amazon.com>

On 05.01.21 17:51, George Prekas wrote:
> On 9/24/2020 9:20 AM, George Prekas wrote:
>> 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.
>>
>> Signed-off-by: George Prekas <prekageo@amazon.com>
>> ---
>>  scripts/gdb/linux/lists.py | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/scripts/gdb/linux/lists.py b/scripts/gdb/linux/lists.py
>> index c487ddf09d38..bae4d70b7eae 100644
>> --- a/scripts/gdb/linux/lists.py
>> +++ b/scripts/gdb/linux/lists.py
>> @@ -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
> 
> Happy New Year!

Same to you!

> 
> Any updates on this?
> 

Sorry, slipped through.

Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>

Andrew, please pick this up.

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

      reply	other threads:[~2021-01-05 19:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-24 14:20 George Prekas
2021-01-05 16:51 ` George Prekas
2021-01-05 19:08   ` Jan Kiszka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cef588b9-ad70-e840-7cc6-f1896ccfcbbf@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=akpm@linux-foundation.org \
    --cc=kbingham@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=prekageo@amazon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®