Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp450622pxj; Thu, 20 May 2021 13:14:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgx0NGr9RJ1NgP5UKj24o32wOBBM9CD/yt7GYFpYXL8itO9hMOWMsOptHQ6Yy96IADmJIu X-Received: by 2002:a02:cf32:: with SMTP id s18mr8264409jar.31.1621541650206; Thu, 20 May 2021 13:14:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621541650; cv=none; d=google.com; s=arc-20160816; b=LT2LK0qSHlteZYJWCGbbUI6q12kejKiqegq3qiNVyV0Ux3v5iPEd066aW0LshEYNfV sHQ0l36vVfeCniibVaGcht+zUD03GBsBAtdbXQizBOyKZCidlDAdGdWJCDuo/yRlUrNf uKmv08Tc8uT34t9Ro7ZlhcD2yHKxpewUYug78jpeU/04FcB1JNpC5STzN2fbploWiGa/ T+FovCStv0ilRUu6NUnJnnuUu4wgF8AzHXiEQie9yjBSpOnif3Jh9ggnNDn8iwPaGUzz A+TsfVrszTkYxbqzYGSJbZ0BqPZJyvoFYP06kZ8XbYZNJ8xfzD27JIz/9C01Xof4lCfY NR0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uw+ktayf7vxZ+PzMPqxabn2+P2BHm3CEwwQHKU4cKks=; b=W8YZKbe5RUG+eWT9SQTlHywV2wn7Bw0f82zV/ef0j3HfCnOvEjdFMIxaAJp/y/0tnB 1z43pTIaOkvaTg1fFVbRG+Raqd3m069VliVLvpJmyQmsYmRbRmDRE3Csu2MagyYyxvGX zyYKiUApJ7zqF/nU0Rskx+0I/yvirL+MvJWTLMduXe/t6EpAQzpdIU0ysEhUXNPGMd+K mNgVujdBl83z9YiO8RkROiO6Sx9op7lmZIaLM/I9fdDVIc/v1rBBmJNaU5AQgqgAkrWR Ba6lQq7mRk9Vl/8jKVRIeLVlzpK3tB89PbpRX9EgNmXmNF74/FD/qwv+yqimRLmWJ+6Y iSdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JlkqN1qD; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k21si3057008ioh.78.2021.05.20.13.13.57; Thu, 20 May 2021 13:14:10 -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=@linuxfoundation.org header.s=korg header.b=JlkqN1qD; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238318AbhETKrV (ORCPT + 99 others); Thu, 20 May 2021 06:47:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:60414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237301AbhETKbe (ORCPT ); Thu, 20 May 2021 06:31:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7E37461C3D; Thu, 20 May 2021 09:52:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504332; bh=qDIU5nDtAF+MxM4whC/tHUMuQreS2AMw9hzPurZjGws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JlkqN1qDZ1oyx9IrV734m4dq5soeqdn3eerzgvjrN1g9gUXPG5dlH0AMV2DLqN/Yp D6mkXcbEV/NX3BF+eyWG2D1DSbuSVv8ndXaUGtQHq+I9QQX+VrBNxugF5cNnrmSGJO GTFRqIJWwQzowkK3cXA1sZ/VTzf9sFtaYR2K9SF4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yang Li , Alexander Shishkin , Ingo Molnar , Jiri Olsa , Mark Rutland , Namhyung Kim , Peter Zijlstra , Srikar Dronamraju , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.14 196/323] perf symbols: Fix dso__fprintf_symbols_by_name() to return the number of printed chars Date: Thu, 20 May 2021 11:21:28 +0200 Message-Id: <20210520092126.829906937@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnaldo Carvalho de Melo [ Upstream commit 210e4c89ef61432040c6cd828fefa441f4887186 ] The 'ret' variable was initialized to zero but then it was not updated from the fprintf() return, fix it. Reported-by: Yang Li cc: Alexander Shishkin cc: Ingo Molnar cc: Jiri Olsa cc: Mark Rutland cc: Namhyung Kim Cc: Peter Zijlstra Cc: Srikar Dronamraju Fixes: 90f18e63fbd00513 ("perf symbols: List symbols in a dso in ascending name order") Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/util/symbol_fprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/symbol_fprintf.c b/tools/perf/util/symbol_fprintf.c index 6dd2cb88ccbe..d6ed44bd1eba 100644 --- a/tools/perf/util/symbol_fprintf.c +++ b/tools/perf/util/symbol_fprintf.c @@ -66,7 +66,7 @@ size_t dso__fprintf_symbols_by_name(struct dso *dso, for (nd = rb_first(&dso->symbol_names[type]); nd; nd = rb_next(nd)) { pos = rb_entry(nd, struct symbol_name_rb_node, rb_node); - fprintf(fp, "%s\n", pos->sym.name); + ret += fprintf(fp, "%s\n", pos->sym.name); } return ret; -- 2.30.2