From patchwork Tue May 26 18:53:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 225344 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 6DC30C433E0 for ; Tue, 26 May 2020 19:13:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 448E5208B3 for ; Tue, 26 May 2020 19:13:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590520383; bh=REDsuEysCkGozpy/tAflcxRA3nXs5g++jF7F2KLZaHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=q5mRgQiCZ8RtZ++R6WRLXh98dhz5YiBs1qwmE1vUmJUAb7QAh7nfnHXZuVgirP5sc t8tgiKQsQzZuQFlcQWbrb4aLtiWiDhmceKCPop1g9uXGDopKkNwZfQ4kptvkSNzOAk 96cuiVEwN2kREG8+jdvcbQvuJ1qCANbAWtgoHCtY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404189AbgEZTNC (ORCPT ); Tue, 26 May 2020 15:13:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:42680 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404179AbgEZTNA (ORCPT ); Tue, 26 May 2020 15:13:00 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DA6D7208FE; Tue, 26 May 2020 19:12:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590520379; bh=REDsuEysCkGozpy/tAflcxRA3nXs5g++jF7F2KLZaHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VlLi/ojzCXYktIMoXeK6rKfuwFxh2kDiOS9QKzmBoysu21Wdkch4J3TdIb7HqJ9Qj JJqIQ1g9DNMsb0LMOxcmXOy/ZCclbSdoA54d66E+EbRlDFrtzNkvNbyKeA8nrPeqs6 R6h5JHcktTykReYjCgByZfFAk4vjne86V3nEr9YY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, 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 5.6 055/126] scripts/gdb: repair rb_first() and rb_last() Date: Tue, 26 May 2020 20:53:12 +0200 Message-Id: <20200526183942.698546702@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526183937.471379031@linuxfoundation.org> References: <20200526183937.471379031@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 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 39db889b874c..c4b991607917 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))