lkml.org 
[lkml]   [2021]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sfc_ef100: potential dereference of null pointer
Hi Jiasheng,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.16-rc5 next-20211214]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Jiasheng-Jiang/sfc_ef100-potential-dereference-of-null-pointer/20211215-174422
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 5472f14a37421d1bca3dddf33cabd3bd6dbefbbc
config: microblaze-allyesconfig (https://download.01.org/0day-ci/archive/20211215/202112152115.lNKRy4uk-lkp@intel.com/config)
compiler: microblaze-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/fc56ac03164889a206ee1b65187a8be7aa7b0f04
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jiasheng-Jiang/sfc_ef100-potential-dereference-of-null-pointer/20211215-174422
git checkout fc56ac03164889a206ee1b65187a8be7aa7b0f04
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=microblaze SHELL=/bin/bash drivers/net/ethernet/sfc/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

drivers/net/ethernet/sfc/ef100_nic.c: In function 'ef100_update_stats':
>> drivers/net/ethernet/sfc/ef100_nic.c:608:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
608 | struct ef100_nic_data *nic_data = efx->nic_data;
| ^~~~~~


vim +608 drivers/net/ethernet/sfc/ef100_nic.c

b593b6f1b492170 Edward Cree 2020-08-03 599
b593b6f1b492170 Edward Cree 2020-08-03 600 static size_t ef100_update_stats(struct efx_nic *efx,
b593b6f1b492170 Edward Cree 2020-08-03 601 u64 *full_stats,
b593b6f1b492170 Edward Cree 2020-08-03 602 struct rtnl_link_stats64 *core_stats)
b593b6f1b492170 Edward Cree 2020-08-03 603 {
b593b6f1b492170 Edward Cree 2020-08-03 604 __le64 *mc_stats = kmalloc(array_size(efx->num_mac_stats, sizeof(__le64)), GFP_ATOMIC);
fc56ac03164889a Jiasheng Jiang 2021-12-15 605 if (!mc_stats)
fc56ac03164889a Jiasheng Jiang 2021-12-15 606 return 0;
fc56ac03164889a Jiasheng Jiang 2021-12-15 607
b593b6f1b492170 Edward Cree 2020-08-03 @608 struct ef100_nic_data *nic_data = efx->nic_data;
b593b6f1b492170 Edward Cree 2020-08-03 609 DECLARE_BITMAP(mask, EF100_STAT_COUNT) = {};
b593b6f1b492170 Edward Cree 2020-08-03 610 u64 *stats = nic_data->stats;
b593b6f1b492170 Edward Cree 2020-08-03 611
b593b6f1b492170 Edward Cree 2020-08-03 612 ef100_common_stat_mask(mask);
b593b6f1b492170 Edward Cree 2020-08-03 613 ef100_ethtool_stat_mask(mask);
b593b6f1b492170 Edward Cree 2020-08-03 614
b593b6f1b492170 Edward Cree 2020-08-03 615 efx_nic_copy_stats(efx, mc_stats);
b593b6f1b492170 Edward Cree 2020-08-03 616 efx_nic_update_stats(ef100_stat_desc, EF100_STAT_COUNT, mask,
b593b6f1b492170 Edward Cree 2020-08-03 617 stats, mc_stats, false);
b593b6f1b492170 Edward Cree 2020-08-03 618
b593b6f1b492170 Edward Cree 2020-08-03 619 kfree(mc_stats);
b593b6f1b492170 Edward Cree 2020-08-03 620
b593b6f1b492170 Edward Cree 2020-08-03 621 return ef100_update_stats_common(efx, full_stats, core_stats);
b593b6f1b492170 Edward Cree 2020-08-03 622 }
b593b6f1b492170 Edward Cree 2020-08-03 623

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

\
 
 \ /
  Last update: 2021-12-15 15:04    [W:0.039 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site