Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3979874pxk; Tue, 22 Sep 2020 07:32:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzg6XS36V3LnNAME5ssZE5XcqehxrWPTXybje5hBKj8cwO0yLLCpFtcK40VAisxRaKJHbl X-Received: by 2002:a17:907:20a3:: with SMTP id pw3mr5428133ejb.314.1600785178578; Tue, 22 Sep 2020 07:32:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600785178; cv=none; d=google.com; s=arc-20160816; b=XbmRYW66iuziGYhRo+Ld6+a21cGyYapa4+35sjtSidgjAlXpcVavVnYUPMaGO+sS7c YXQ1CgAPPng/7Z5A+hGPQxMkL7aSfWQy4AUo828VRlZamWuiRzQ3iMpTIFLFDqDaUDH/ s2nEf3F+ut3xNxrsZOehMXmuVwwlarRSrcEjOZTCBgtH9Yh/x8frSOZiNx5XiD6BhofC C3b3a7gRhWvweutC6jK1Ojk647IsnQ7z1O2oLo5tcIKGrmwp/dIXZf+6mQyaP0a77Idr 9EZs7XoJsKl67Bf+YgzJLL+YqE/r5Hoc6Ofa43iqgPyRSf0T9FEk5a5nu3t4Ux7iE6E8 MXJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :mime-version:user-agent:date:message-id:subject:from:cc:to :dkim-signature; bh=chOAFRzhLpeku7MlIinWALn5eKMG3/rsd9Ptm05qR9U=; b=ODTaNQzwyBTQaqpen4pyKTFjdnbhHjpkDfJi6WH69euI6jZjjM0738WqwGF0nRAR22 SU1828bvMfrIKrZrDnVAkTyiVC0I1jpBGjcxephEJj3Me9bIYwuvzBSSF4uKiU8+ng+v tzqSaYNQiUDyP8og6cMJwZNtMrmyvJNivU6P+JnMx7fNvebEIwKebr0sKHRTqcYt5Y3b BkV8uDMjzcLfz8zm0XubLX7o0bH89r3lQw9eZImHRqOEFNiYl5tRtdeneKXLJ/ggO4d4 m/8qePJnwBkqzR78azj8DFMX+KUSzXl5uhCqg0WLNgMzVUL86M7oUCLpAhS4Qcrxb+fx m7PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="FsLXHca/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b7si10570594edz.159.2020.09.22.07.32.31; Tue, 22 Sep 2020 07:32:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="FsLXHca/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726700AbgIVO22 (ORCPT + 99 others); Tue, 22 Sep 2020 10:28:28 -0400 Received: from smtp-fw-6001.amazon.com ([52.95.48.154]:47901 "EHLO smtp-fw-6001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726494AbgIVO22 (ORCPT ); Tue, 22 Sep 2020 10:28:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1600784908; x=1632320908; h=to:cc:from:subject:message-id:date:mime-version: content-transfer-encoding; bh=chOAFRzhLpeku7MlIinWALn5eKMG3/rsd9Ptm05qR9U=; b=FsLXHca/mx2WHXGG3Rq3p/W5uj/whFqsHZbgy26NNKzq7vFKpr4PCeiA AIFzVL0HLn3V5d7OHx41W3RAXsOQsvChNXwrMpiyGVpZBYgCr0v4RsJGc +otaWyaNZeg+IQJiK7DmIye5Aua2ugtJiNVvImTk97QLcOYj5YVLt2EYC 0=; X-IronPort-AV: E=Sophos;i="5.77,291,1596499200"; d="scan'208";a="56974341" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2a-69849ee2.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6001.iad6.amazon.com with ESMTP; 22 Sep 2020 14:28:26 +0000 Received: from EX13MTAUWC002.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2a-69849ee2.us-west-2.amazon.com (Postfix) with ESMTPS id BDB27A0669; Tue, 22 Sep 2020 14:28:24 +0000 (UTC) Received: from EX13D12UWC002.ant.amazon.com (10.43.162.253) by EX13MTAUWC002.ant.amazon.com (10.43.162.240) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 22 Sep 2020 14:28:24 +0000 Received: from [10.88.31.162] (10.43.161.85) by EX13D12UWC002.ant.amazon.com (10.43.162.253) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 22 Sep 2020 14:28:23 +0000 To: CC: Jan Kiszka , Kieran Bingham From: George Prekas Subject: [PATCH] scripts/gdb: fix list_for_each Message-ID: <3b382958-9f1d-a3d2-a239-09ba084227e6@amazon.com> Date: Tue, 22 Sep 2020 09:28:21 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.43.161.85] X-ClientProxiedBy: EX13D01UWA003.ant.amazon.com (10.43.160.107) To EX13D12UWC002.ant.amazon.com (10.43.162.253) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the next pointer is NULL, list_for_each gets stuck in an infinite loop. Signed-off-by: George Prekas ---  scripts/gdb/linux/lists.py | 2 ++  1 file changed, 2 insertions(+) diff --git a/scripts/gdb/linux/lists.py b/scripts/gdb/linux/lists.py index c487ddf09d38..424a91c1aa8b 100644 --- a/scripts/gdb/linux/lists.py +++ b/scripts/gdb/linux/lists.py @@ -27,6 +27,8 @@ def list_for_each(head):          raise TypeError("Must be struct list_head not {}"                             .format(head.type)) +    if head['next'] == 0: +        return      node = head['next'].dereference()      while node.address != head.address:          yield node.address -- 2.24.3.AMZN