Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp887779yba; Thu, 18 Apr 2019 11:14:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxDg7iYuRqAQJ0UbBioqX1S8PVsTWyqGOB0V2xxmNv87Daiu8jWzZ3n5dLOIOF5wxpfn83G X-Received: by 2002:a63:121f:: with SMTP id h31mr6274697pgl.287.1555611244644; Thu, 18 Apr 2019 11:14:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611244; cv=none; d=google.com; s=arc-20160816; b=KP7BW7f87QKQF3dIeCKohk4llX7dNEMPtPvCobK8v1cVNzwenmD7lwQLPIqYgvGetk bjrMK1Ve/8OzN2DviaoO0PNIUHS5Ap11Mwwq5g1E4MZxaA51IJtRv73FmAASyN189q2I WR1fFzWShTdsmzNE+PsiW2OM2mpm4HP7S3LwrE5BDGyciBVj7aNplcJXz6yaAVdO67Ca r1fImT8tOBIdQUfQ7UWqdiJ3nmTQE4uQ4wx8meG5oMAJrj4ZYqvIVbfVBViC0vMl8adh J0H5KBoaencQdgFDliSzP3bMdxP16CVsw5Sr+hMnckG46pGF6r90em+1qjgm18kMFTlP qW/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5WtslTxjZotkHX+8k5gNpMY6o+EOZ87jCt1Db8adsCo=; b=Tcz9mvRyX//mwLwPl3CV6i0lxOS5N5EEQiz2/zO9HRoVqJU30654mhj0xSKiVvw9ak uXZHK2zeBG/wiQl1RDFMu3ARqCq+iIlfm4P39u/wEwKJWEoV3WhSG8hxw8qIjlHotHjz PiiHffPpZ7uuilIjtwk8Q4OpVFzUSQbhKsDKERSrCWphcODigZcfmWcat3asj6bMLTse 2nsbz6sNQYAdwlxJXAvN5T91VSNH88L1C1iz8Jt0sRydekB57klqMfYF3/2k8byimYca YYcbmDtkXM9BQj98khvhAPMxVl4Bi+gCCYDgOuRnC3nIbtvbO9SDiabjknIQJSpAUQMj DHCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="MEVP/YNM"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q190si3130538pfc.215.2019.04.18.11.13.49; Thu, 18 Apr 2019 11:14:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="MEVP/YNM"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404202AbfDRSK5 (ORCPT + 99 others); Thu, 18 Apr 2019 14:10:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:42880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403870AbfDRSKy (ORCPT ); Thu, 18 Apr 2019 14:10:54 -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 5DFD2218A1; Thu, 18 Apr 2019 18:10:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555611053; bh=8U5PM7f0zvWQQLwZGQonVtrDfBU1SQ1aMA+hGNIrycg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MEVP/YNMOrXHJp0U8REapWfdDktVBJz9MwniNQudL0KuW7M2351bVlwh6+S5xpxPx O5nUDw5MhHMaWl9smOkDw1inQV8J1YCXqd3iuQmtrLFJ3+dw1uRXrR8E6GKvBRoiFT Bc6tRIgUZ/742ZIVoaS+LRA3UpySvODlaTLFnmpc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Changbin Du , Jiri Olsa , Alexei Starovoitov , Daniel Borkmann , Eric Saint-Etienne , Namhyung Kim , Peter Zijlstra , "Steven Rostedt (VMware)" , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.0 42/93] perf map: Remove map from names tree in __maps__remove() Date: Thu, 18 Apr 2019 19:57:20 +0200 Message-Id: <20190418160441.729880336@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160436.781762249@linuxfoundation.org> References: <20190418160436.781762249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit b49265e04410b97b31a5ee66ef6782c1b2d6cd2c ] There are two trees for each map inserted by maps__insert(), so remove it from the 'names' tree in __maps__remove(). Detected with gcc's ASan. Signed-off-by: Changbin Du Reviewed-by: Jiri Olsa Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Eric Saint-Etienne Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Steven Rostedt (VMware) Fixes: 1e6285699b30 ("perf symbols: Fix slowness due to -ffunction-section") Link: http://lkml.kernel.org/r/20190316080556.3075-11-changbin.du@gmail.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/util/map.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index 6751301a755c..750ecc3dad50 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c @@ -911,6 +911,9 @@ static void __maps__remove(struct maps *maps, struct map *map) { rb_erase_init(&map->rb_node, &maps->entries); map__put(map); + + rb_erase_init(&map->rb_node_name, &maps->names); + map__put(map); } void maps__remove(struct maps *maps, struct map *map) -- 2.19.1