linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: hao.wu@intel.com
Cc: linux-fpga@vger.kernel.org
Subject: [bug report] fpga: dfl: fme: add performance reporting support
Date: Sat, 2 May 2020 16:24:19 +0300	[thread overview]
Message-ID: <20200502132419.GA41486@mwanda> (raw)

Hello Wu Hao,

The patch 724142f8c42a: "fpga: dfl: fme: add performance reporting
support" from Apr 27, 2020, leads to the following static checker
warning:

	drivers/fpga/dfl-fme-perf.c:948 fme_perf_offline_cpu()
	error: potential NULL dereference 'priv'.

drivers/fpga/dfl-fme-perf.c
   941  static int fme_perf_offline_cpu(unsigned int cpu, struct hlist_node *node)
   942  {
   943          struct fme_perf_priv *priv;
   944          int target;
   945  
   946          priv = hlist_entry_safe(node, struct fme_perf_priv, node);
                                  ^^^^^
It doesn't make sense to use the _safe() version if we're not going to
check for NULL.

   947  
   948          if (cpu != priv->cpu)
   949                  return 0;
   950  
   951          target = cpumask_any_but(cpu_online_mask, cpu);
   952          if (target >= nr_cpu_ids)
   953                  return 0;
   954  
   955          priv->cpu = target;
   956          return 0;
   957  }

regards,
dan carpenter

             reply	other threads:[~2020-05-02 13:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-02 13:24 Dan Carpenter [this message]
2020-05-06  6:31 ` [bug report] fpga: dfl: fme: add performance reporting support Xu Yilun
2020-05-07  6:42   ` Wu, Hao

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=20200502132419.GA41486@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=hao.wu@intel.com \
    --cc=linux-fpga@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).