Subject: Re: [PATCH] net: phonet: Add error handling in phonet_device_init

From: kernel test robot <[email-masked]>
Date: Mon, 25 Sep 2023 23:58:53 +0800

Hi liuhaoran,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]
[also build test WARNING on net/main linus/master horms-ipvs/master v6.6-rc3 next-20230925]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/liuhaoran/net-phonet-Add-error-handling-in-phonet_device_init/20230923-200141
base:   net-next/main
patch link:    https://lore.kernel.org/r/20230923115847.32740-1-liuhaoran14%40163.com
patch subject: [PATCH] net: phonet: Add error handling in phonet_device_init
config: x86_64-randconfig-123-20230925 (https://download.01.org/0day-ci/archive/20230925/[email-masked]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230925/[email-masked]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email-masked]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email-masked]/

sparse warnings: (new ones prefixed by >>)
>> net/phonet/pn_dev.c:339:13: sparse: sparse: incorrect type in assignment (different base types) @@     expected int err @@     got struct proc_dir_entry * @@
   net/phonet/pn_dev.c:339:13: sparse:     expected int err
   net/phonet/pn_dev.c:339:13: sparse:     got struct proc_dir_entry *

vim +339 net/phonet/pn_dev.c

   331	
   332	/* Initialize Phonet devices list */
   333	int __init phonet_device_init(void)
   334	{
   335		int err = register_pernet_subsys(&phonet_net_ops);
   336		if (err)
   337			return err;
   338	
 > 339		err = proc_create_net("pnresource", 0, init_net.proc_net, &pn_res_seq_ops,
   340				      sizeof(struct seq_net_private));
   341	
   342		if (!err)
   343			return err;
   344	
   345		err = register_netdevice_notifier(&phonet_device_notifier);
   346	
   347		if (!err)
   348			return err;
   349	
   350		err = phonet_netlink_register();
   351	
   352		if (err)
   353			phonet_device_exit();
   354		return err;
   355	}
   356	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki