From patchwork Tue May 26 18:53:05 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: 225265 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=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 EB7AEC433DF for ; Tue, 26 May 2020 19:24:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9AC420888 for ; Tue, 26 May 2020 19:24:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590521066; bh=REDsuEysCkGozpy/tAflcxRA3nXs5g++jF7F2KLZaHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=NINQmi0dcgVYnfS3gfVqNI3q/RwCmWKbKukUPmnZkliMQJRVz8d3EXoocFlkNyONs 57PI+ezfkO/XtfHECrFh6/LTFAEuOA2NTouTZDRhqi2gq6VyMpBs0xh7OysmbIoPGT lvZiDOQhQEJz2vOYaLWaTfls8aq8/v6/w+7yeBvk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391729AbgEZTHu (ORCPT ); Tue, 26 May 2020 15:07:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:36662 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391725AbgEZTHt (ORCPT ); Tue, 26 May 2020 15:07:49 -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 0F20A20873; Tue, 26 May 2020 19:07:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590520068; bh=REDsuEysCkGozpy/tAflcxRA3nXs5g++jF7F2KLZaHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mUSKz0eNft7l939ZCYs/D7uvaDTMSnwJTdEkfvW/ZfGPZw7APLhDUuQ4kNunwDQJD CF2EdTranoKgcnvTSYSnZdTzi3krr9UG26urKfBdPcIvv+wy0+2FMkaZXNclr81zYj HUHvFO6wgEaj+H6kirxOh0D45D8WL9myqEoGSDwQ= 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.4 047/111] scripts/gdb: repair rb_first() and rb_last() Date: Tue, 26 May 2020 20:53:05 +0200 Message-Id: <20200526183937.360700066@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526183932.245016380@linuxfoundation.org> References: <20200526183932.245016380@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))