On Sat, May 02, 2020 at 04:24:19PM +0300, Dan Carpenter wrote: > 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. Thanks for catching this. Will fix it. Regards, Yilun. > > 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