From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE998C433E2 for ; Thu, 14 May 2020 19:09:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AA63D2065F for ; Thu, 14 May 2020 19:09:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589483353; bh=MlcSKljYgpljWuTEmbal7pi1lzXa0+HQgb/c7fOshqM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=QUOSeM6h5a10jBjqLNvqf6IUNnO+JpMVWLjQ8poAwTuH8Zvrfh7rcoETPo70TDHYh Nf4McEfLOw95iP8OtRWf0H+eBlr4AJU1WbGNBJRs6XwY7akFLk1fMlRnOWA/eXVF8x 04O3bK/bZ8Yo6Amq0TSny/Dmb5bI+ys/cf9IdGTA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728514AbgENSw6 (ORCPT ); Thu, 14 May 2020 14:52:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:51770 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728498AbgENSw5 (ORCPT ); Thu, 14 May 2020 14:52:57 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2AE8C207BB; Thu, 14 May 2020 18:52:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589482376; bh=MlcSKljYgpljWuTEmbal7pi1lzXa0+HQgb/c7fOshqM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=evYAfMKkbXm3BtszFEzq/4CcopWluGbQRZUaxOy7s7XSytzG9rVNMzOBCtTQdxkXD PekUC8WeQlwwK8zpfyJu4qkHYJOYJiAL1SH4iJDl2Wt72Oa7wrjreUNMoQjUlnZM4s f6Lm8SU6/E35rDA9MbA+bRh6d2ET+sFamvyLyfLM= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Aymeric Agon-Rambosson , Andrew Morton , Stephen Boyd , Jan Kiszka , Kieran Bingham , Douglas Anderson , Nikolay Borisov , Jackie Liu , Jason Wessel , Linus Torvalds , Sasha Levin Subject: [PATCH AUTOSEL 5.6 53/62] scripts/gdb: repair rb_first() and rb_last() Date: Thu, 14 May 2020 14:51:38 -0400 Message-Id: <20200514185147.19716-53-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200514185147.19716-1-sashal@kernel.org> References: <20200514185147.19716-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Aymeric Agon-Rambosson [ Upstream commit 50e36be1fb9572b2e4f2753340bdce3116bf2ce7 ] The current implementations of the rb_first() and rb_last() gdb functions have a variable that references itself in its instanciation, which causes the function to throw an error if a specific condition on the argument is met. The original author rather intended to reference the argument and made a typo. Referring the argument instead makes the function work as intended. Signed-off-by: Aymeric Agon-Rambosson Signed-off-by: Andrew Morton Reviewed-by: Stephen Boyd Cc: Jan Kiszka Cc: Kieran Bingham Cc: Douglas Anderson Cc: Nikolay Borisov Cc: Jackie Liu Cc: Jason Wessel Link: http://lkml.kernel.org/r/20200427051029.354840-1-aymeric.agon@yandex.com Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- scripts/gdb/linux/rbtree.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/gdb/linux/rbtree.py b/scripts/gdb/linux/rbtree.py index 39db889b874c9..c4b9916079178 100644 --- a/scripts/gdb/linux/rbtree.py +++ b/scripts/gdb/linux/rbtree.py @@ -12,7 +12,7 @@ rb_node_type = utils.CachedType("struct rb_node") def rb_first(root): if root.type == rb_root_type.get_type(): - node = node.address.cast(rb_root_type.get_type().pointer()) + node = root.address.cast(rb_root_type.get_type().pointer()) elif root.type != rb_root_type.get_type().pointer(): raise gdb.GdbError("Must be struct rb_root not {}".format(root.type)) @@ -28,7 +28,7 @@ def rb_first(root): def rb_last(root): if root.type == rb_root_type.get_type(): - node = node.address.cast(rb_root_type.get_type().pointer()) + node = root.address.cast(rb_root_type.get_type().pointer()) elif root.type != rb_root_type.get_type().pointer(): raise gdb.GdbError("Must be struct rb_root not {}".format(root.type)) -- 2.20.1