linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kim.phillips@amd.com
Cc: linux-perf-users@vger.kernel.org
Subject: [bug report] perf env: Add perf_env__cpuid, perf_env__{nr_}pmu_mappings
Date: Tue, 8 Feb 2022 14:22:39 +0300	[thread overview]
Message-ID: <20220208112239.GA18799@kili> (raw)

Hello Kim Phillips,

This is a semi-automatic email about new static checker warnings.

The patch 9fe8895a27a8: "perf env: Add perf_env__cpuid,
perf_env__{nr_}pmu_mappings" from Aug 17, 2021, leads to the
following Smatch complaint:

    ./tools/perf/util/env.c:476 perf_env__nr_pmu_mappings()
    error: we previously assumed 'env' could be null (see line 470)

./tools/perf/util/env.c
   469	
   470		if (!env || !env->nr_pmu_mappings) { /* Assume local operation */
                     ^^^
Checks for NULL

   471			status = perf_env__read_pmu_mappings(env);
   472			if (status)
   473				return 0;
   474		}
   475	
   476		return env->nr_pmu_mappings;
                       ^^^^
Unchecked dereference

   477	}

regards,
dan carpenter

             reply	other threads:[~2022-02-08 11:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 11:22 Dan Carpenter [this message]
2022-02-09 15:09 ` [bug report] perf env: Add perf_env__cpuid, perf_env__{nr_}pmu_mappings Jiri Olsa
  -- strict thread matches above, loose matches on Subject: below --
2022-07-18 13:15 Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220208112239.GA18799@kili \
    --to=dan.carpenter@oracle.com \
    --cc=kim.phillips@amd.com \
    --cc=linux-perf-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).