Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp24336686rwd; Sat, 1 Jul 2023 18:09:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlESwwxZoq5Dn1S0oA5q5EtHayqMor71FBS70VAfRlodOfKmJYlCb5eOpSn9U/xM7KoC8COV X-Received: by 2002:a17:90a:f98a:b0:262:f273:4a20 with SMTP id cq10-20020a17090af98a00b00262f2734a20mr4371731pjb.42.1688260150679; Sat, 01 Jul 2023 18:09:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688260150; cv=none; d=google.com; s=arc-20160816; b=eaXoNrVoAj5CTrmdlav962o8rkSQ/UC2ice1fwOl7TPphyYYaKp3DuSD/Co16Eol1M U/I9Mmnaz1U2zZEy+EaueNjxfCkgRbzThpwUFPHvX08lBbQa2mP1n2QmmrjMXzT2u1oH rNOfuvonrOJP0zrFUKL3/M8I5AxNnnOYIm5uEHIqnoZhI47mf3+l96XQHS9CKNJyqh/q bs0jpRQjQvndibIH45M0Lvmg4A3FHtyzG3xod0yYRfJgo1+OM9kVuqcnY9k4c6xeVdrV EDryMEVGgi6vVlRNzFF/HQ5zXgXFhj/2bmW26rYEy3lwFYtPCFQjTvxXYcwLbNz4pS/E aQsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=7VxzGPNCj3SpdahEfGhogFHGEex6vSli5niQBvFRemw=; fh=p1U8P5swGzSNicETwlOdAh8ApLVdAktboBzjsDojbU8=; b=DzQhx9RFja1JExHfWvCO6lvOml0EJheiaXuCyvkoEgUY1rW24ki+j6lmCmYkVLXshw bVXrtXAm4akq7f7UwQGftYBd6SKR6zYFrzI0+pN/tF8Gvw8zyttvNAVye5HU+9CBnIlj bdG0NIgU7smSl/uxrTTuM/jR58lwWq6CPlLFs1WerlsHCK50CSguobK6uSXVax/ToFFT i2pqiG+VylgFhwqNKnDlxLdl868CjGCc9H9iU8JfeKa4EVs8p3L8aVasWq/rhOc+KHJA I8q4FWk/sJETPOBm82TzuRScux8PGbRzo4fFETrb3n32lWn0EFwMXbUvV6rW72EsV/JN P8qw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x1-20020a17090a294100b00262dd23b209si13768543pjf.78.2023.07.01.18.08.58; Sat, 01 Jul 2023 18:09:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229520AbjGBBCb convert rfc822-to-8bit (ORCPT + 99 others); Sat, 1 Jul 2023 21:02:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbjGBBCa (ORCPT ); Sat, 1 Jul 2023 21:02:30 -0400 Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F7EF1717; Sat, 1 Jul 2023 18:02:29 -0700 (PDT) Received: by mail-yb1-f178.google.com with SMTP id 3f1490d57ef6-c4d04d50c4cso375247276.1; Sat, 01 Jul 2023 18:02:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688259748; x=1690851748; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xpxQT1popqga6hqikm0/WuMRufOfA5vSFKW1HFmcbgI=; b=Kah+v9SUsXJGdn+Y0dlI3qJWU7dpL8frR5P6rEkDDwxEQg7zWCZcuZIfJUvNpuMdpi CHBQtzaUue/K3VXxf/pb/wN1DVwykl6871HuLQXguP83Wv+QBBG9TcXvlNhkoBHPdfQJ NvVQxKBPECgr7Hb6XFgB8TBwUUFbdpzbvG0G8gw4VogfnUGhFR86EwVktTRNyZ9xOc8/ pKJn1CZs+ErxZH0+bUyDiqPxysSagPrLlzEbPX3zBGYN2FKTcnTE15M0t7D7UTumJ2iD FGp+0L5faLzD11ksAKd/dmckcIUTOu9ysGFoSz13xTp0FIC2SAbEmxWQLTPBNXJlDDZl lHWA== X-Gm-Message-State: ABy/qLYT9zCp9vszQ3MZJmF5xeeWAA4W1iTV7PT+9bxHSZfU1ZBVG2zn ZTRsEHNdpZsPWCONraPSocjQv0EHZWblGUbfn6RmsbOX X-Received: by 2002:a25:fb0c:0:b0:c1a:b0e2:e930 with SMTP id j12-20020a25fb0c000000b00c1ab0e2e930mr6029928ybe.3.1688259748079; Sat, 01 Jul 2023 18:02:28 -0700 (PDT) MIME-Version: 1.0 References: <20230630153840.858668-1-james.clark@arm.com> In-Reply-To: From: Namhyung Kim Date: Sat, 1 Jul 2023 18:02:16 -0700 Message-ID: Subject: Re: [PATCH] perf symbol: Fix uninitialized return value in symbols__find_by_name() To: Ian Rogers Cc: James Clark , linux-perf-users@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 30, 2023 at 8:49 AM Ian Rogers wrote: > > On Fri, Jun 30, 2023 at 8:39 AM James Clark wrote: > > > > found_idx and s aren't initialized, so if no symbol is found then the > > assert at the end will index off the end of the array causing a > > segfault. The function also doesn't return NULL when the symbol isn't > > found even if the assert passes. Fix it by initializing the values and > > only setting them when something is found. > > > > Fixes the following test failure: > > > > $ perf test 1 > > 1: vmlinux symtab matches kallsyms : FAILED! > > > > Fixes: 259dce914e93 ("perf symbol: Remove symbol_name_rb_node") > > Signed-off-by: James Clark > > Thanks, and thanks for the Fixes. > > Acked-by: Ian Rogers Applied to perf-tools-next, thanks!