Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2076806rdb; Mon, 9 Oct 2023 11:40:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHc6h389D+h7o3hFSb7GdoJKLgk3WvlTUbzyxgTKx2Fyo3A3lsBBEjxZAJ9dQY8rrn5n4ew X-Received: by 2002:a05:6a00:1ac6:b0:690:2818:a4ce with SMTP id f6-20020a056a001ac600b006902818a4cemr21615659pfv.7.1696876836640; Mon, 09 Oct 2023 11:40:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696876836; cv=none; d=google.com; s=arc-20160816; b=X5W0khSpzoQl/Ov3IWxcMFXagdENcSTrSWoCOo4GNombcqBQtTFBKKw+P5u2IbEDXq fj+fUJEawameJsmKn/xatbuH0x1GC92YwOj9ocD59wELveygptKaK4ExbcaIkiv22R2K XvYjHZl24JKg99MapLZDnHEib4DMrvyA9WM4YH5NsIwwy+/J+VmC9KODrXW8eLFagtKs +iAVq7VFhzIbYscrlh2OEXcfafqtuKuShbo1qQzanSnsTwSg+8qSOqNduN04P7e43mib 270q/O6fL8tHXPd0V9ND8NinAqsrwOh263Dld/qVItkrQonvEtiz/1kmaWKv/9pSs/of ngBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=uSqAvWdBbUtQxC7pnyJJtR4WVxr7hcg6OVnTaxh+F6M=; fh=8uoRd8OfBKdrcgzCS0TCbKG83gg6rx5b6zeE6Tx82zI=; b=CFHuteW6cflXeMYQfLAM3O55b3XSMpL0qpmlyWy5Q2K/nhSvYphmGQB4qXhMkIhHHM 08tZSULXgQplywPvPKEr02xNdhT8EiJgSQU6Hfj6iJlFN5qOROszaF4SNnfVDo1tDC4q A2EvSmDE28BKsD7/6mJe8tatoszqTfY6weS9z/4+5LjOoW+Ej9OYAqRWeEbTsLORR57J Mr0o2TjX8WwOfL+xGAIoS4VAywQ5MNLqSXDpsGdbfpXMYVnYHZ5SMIbCD/87SqMn/o9Q EbCnSxUN12lqgW236CD4wbevoxX2cf/GUpJKOSFvImPPYbrRXQz88bCZbZ0d3VwWtEMw BcdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=nXL+qmAY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id cw1-20020a056a00450100b00690a7aefa50si7620086pfb.325.2023.10.09.11.40.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 11:40:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=nXL+qmAY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id E9927806E3D4; Mon, 9 Oct 2023 11:40:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378237AbjJISkW (ORCPT + 99 others); Mon, 9 Oct 2023 14:40:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378356AbjJISkC (ORCPT ); Mon, 9 Oct 2023 14:40:02 -0400 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD85111B for ; Mon, 9 Oct 2023 11:39:54 -0700 (PDT) Received: by mail-pg1-x549.google.com with SMTP id 41be03b00d2f7-55afcc54d55so4380996a12.0 for ; Mon, 09 Oct 2023 11:39:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696876794; x=1697481594; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=uSqAvWdBbUtQxC7pnyJJtR4WVxr7hcg6OVnTaxh+F6M=; b=nXL+qmAYa1mUdOquFhy+XA/PWm93Ug1IW4cRgHg+EqS00GRLOom2nBJGffgxekuDXV wbrE1PmxDKYLYPPiT8kuXB2rEVLLXt/DZxHCItIPQ4PNJOTKSpTEDUswFBtWZma1i0BY 7KYRrcsDRVikprlCDbpKoctnizhnSStoR7IoKOYjNZAjz6iKIN3z82prctEov4KWfVtO HADyYWdsJctr2SoudMqgxo9DL9CrlN97HTGEKFUfyuLjB5nCovyZ6PznLrZYcc61x+g0 5L9e+C2vBdTcD44dUiDnoTG7dryyPmQ2gXGapHoSTv5mqU4L8r0GuakCTvSjh/h0conU 4rZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696876794; x=1697481594; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uSqAvWdBbUtQxC7pnyJJtR4WVxr7hcg6OVnTaxh+F6M=; b=k90EyTIWk+ndupsDaSW6m/pBsckEGGqd3w3yBBqrH1wULCcPeEbOL4EF1okJvPKjZi CW+uUeZFZ5v7KD2j/R+eakKxkXjXA1cw/Basm79dOFLI5MHoU86d0a+ty/yxNL1Nn8TO hfD5BfGRPKtLe8R2BtGN8ub1QjUpiNNSb+NSNQO3hK9hAumGq0PFxNnvuqG3ms5oKV8k PHgp1hMPfvn+Z2iWOOxifaKcwqDW+7FUJX4m4y4CS7dX+WHUmaWeAv5/Iwt/Yfp5m9yA RKEi5d8Ss/aobo2FBHiSG71hW6+apqoy85L/xDuU5MPZhBrJNczzXzLn0NNwie1AJvF9 wTxw== X-Gm-Message-State: AOJu0Yw297KTjMd7A7zLwvL1oLh0ZGqd2D3PgtWRh/O9vOR0SiEaL5gh 0pJLZ/uuiJXFUn8CpYALPyHx+fYBRP4l X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:ac4a:9b94:7158:3f4e]) (user=irogers job=sendgmr) by 2002:a17:90a:bc48:b0:277:d8:abd9 with SMTP id t8-20020a17090abc4800b0027700d8abd9mr318272pjv.0.1696876794049; Mon, 09 Oct 2023 11:39:54 -0700 (PDT) Date: Mon, 9 Oct 2023 11:39:13 -0700 In-Reply-To: <20231009183920.200859-1-irogers@google.com> Message-Id: <20231009183920.200859-13-irogers@google.com> Mime-Version: 1.0 References: <20231009183920.200859-1-irogers@google.com> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog Subject: [PATCH v3 11/18] perf hists browser: Avoid potential NULL dereference From: Ian Rogers To: Nathan Chancellor , Nick Desaulniers , Tom Rix , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Yang Jihong , Huacai Chen , Ming Wang , Kan Liang , Ravi Bangoria , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-4.8 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 09 Oct 2023 11:40:34 -0700 (PDT) On other code paths browser->he_selection is NULL checked, add a missing case reported by clang-tidy. Signed-off-by: Ian Rogers --- tools/perf/ui/browsers/hists.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index f02ee605bbce..f4812b226818 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c @@ -3302,7 +3302,7 @@ static int evsel__hists_browse(struct evsel *evsel, int nr_events, const char *h &options[nr_options], &bi->to.ms, bi->to.al_addr); - } else { + } else if (browser->he_selection) { nr_options += add_annotate_opt(browser, &actions[nr_options], &options[nr_options], -- 2.42.0.609.gbb76f46606-goog