Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4619671pxj; Wed, 12 May 2021 09:22:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYL/JJ2rMjXQ8Eyba4aIOBydt7f2jBLUAsG0BQWRDjjUbnBEJXTCbrmFIURA4rBalv1yPB X-Received: by 2002:a05:6402:1109:: with SMTP id u9mr45690434edv.174.1620836554713; Wed, 12 May 2021 09:22:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620836554; cv=none; d=google.com; s=arc-20160816; b=DcRifKfkyuZFmIpHTJPD8fQXhrbSCTxjjjp2Gt3hD6i6qsL0feLT+3BTv1ltiq9FrZ aKjjh96d0Axp+PD+fPuyA+lme7wm3zeHU8dRFGx6gatGjyen9D4VlfFkkt4N26pDPBcP bHLoOnXfk4TWZYSpCTU4Tcv3RS1NyoDYEXkqy3UqizpoE/e3YQzX+nLoMnk2jkEDp2gK pD/ljEhcrrApQFW4QpJN73LubH3aLo3SPVzd1ZTDoBfsODc95VcrueccgjIr0RZJvs2w vEJq9Pl/hy0vTgdjkDs7xJGNsi/rSPHg+V2ZBua4D54oFxfyDhlQpYKw1YITYZ6hPBSh D91A== 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=xK2Sb/GhJVspkMVdlVIxma0iR3RYMCxtzJWeRMiqM84=; b=l4SDLT6/AiDFeBq3g5DonjYd1GLlHeQ4n4ahjFEs0uHPrUovjM0tLkGkplv7Pd5lp5 FEv3RDWjHZTmJTznoBG5lJ6bd3O8kkx1ts/cCnG5hVAjctctfD/7WiLhgi6v9W4LfWKe fQKSHeCJL+z/sAAVKHDS9XvaX2eGPohTsOdBL6+WrG2+puIIqMTCuTnCqxWgFTFOTnWs yIEvB9/GJq1AqETu6WjwQPIbhvrnIlMOZO4BwVgkAnUm+3qi44cyLjg8F1Ozmc4DbjiO fD41/mijU+sd8tTDZzQ3ns0AO6N5+zL27FkPuJhuqqhWU697hI6M0iFzrZTcZHUqwu74 S8bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uK5hUnH4; 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 z5si110958ede.44.2021.05.12.09.22.09; Wed, 12 May 2021 09:22:34 -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=uK5hUnH4; 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 S239836AbhELQQJ (ORCPT + 99 others); Wed, 12 May 2021 12:16:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:48522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234475AbhELPdB (ORCPT ); Wed, 12 May 2021 11:33:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8EDDF61C4F; Wed, 12 May 2021 15:16:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832608; bh=nN2Pz8T7E5xRcPqnS3oc20AuOaEiDJUAxZswVHHZqbo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uK5hUnH48eUJzG1M7s+o2gVBKLB/0qoXvHp129YQsac6mi5IlXoqEoPP3bwc6mRN4 E2ZHBY5qWD7e8oHvdeORzzqNwF/nYA7d6+mODccCl2r/0tspb6ED3Po/1Cg+yX/U+b 7AUDeW9TvhPbmNFeAfaALvSjDuQcEGyuBZ96p2lw= 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 5.10 349/530] perf symbols: Fix dso__fprintf_symbols_by_name() to return the number of printed chars Date: Wed, 12 May 2021 16:47:39 +0200 Message-Id: <20210512144831.254964327@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@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 35c936ce33ef..2664fb65e47a 100644 --- a/tools/perf/util/symbol_fprintf.c +++ b/tools/perf/util/symbol_fprintf.c @@ -68,7 +68,7 @@ size_t dso__fprintf_symbols_by_name(struct dso *dso, for (nd = rb_first_cached(&dso->symbol_names); 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