public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* drivers/hwmon/corsair-cpro.c:502:79: sparse: sparse: Using plain integer as NULL pointer
@ 2023-12-09 20:52 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-12-09 20:52 UTC (permalink / raw)
  To: Marius Zachmann; +Cc: oe-kbuild-all, linux-kernel, Guenter Roeck

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f2e8a57ee9036c7d5443382b6c3c09b51a92ec7e
commit: 40c3a445422579db8ad96c234dbe6c0ab3f6b936 hwmon: add Corsair Commander Pro driver
date:   3 years, 5 months ago
config: parisc-randconfig-m041-20230821 (https://download.01.org/0day-ci/archive/20231210/202312100455.k6m2eO4N-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20231210/202312100455.k6m2eO4N-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312100455.k6m2eO4N-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/hwmon/corsair-cpro.c:502:79: sparse: sparse: Using plain integer as NULL pointer

vim +502 drivers/hwmon/corsair-cpro.c

   460	
   461	static int ccp_probe(struct hid_device *hdev, const struct hid_device_id *id)
   462	{
   463		struct ccp_device *ccp;
   464		int ret;
   465	
   466		ccp = devm_kzalloc(&hdev->dev, sizeof(*ccp), GFP_KERNEL);
   467		if (!ccp)
   468			return -ENOMEM;
   469	
   470		ccp->buffer = devm_kmalloc(&hdev->dev, OUT_BUFFER_SIZE, GFP_KERNEL);
   471		if (!ccp->buffer)
   472			return -ENOMEM;
   473	
   474		ret = hid_parse(hdev);
   475		if (ret)
   476			return ret;
   477	
   478		ret = hid_hw_start(hdev, HID_CONNECT_HIDRAW);
   479		if (ret)
   480			return ret;
   481	
   482		ret = hid_hw_open(hdev);
   483		if (ret)
   484			goto out_hw_stop;
   485	
   486		ccp->hdev = hdev;
   487		hid_set_drvdata(hdev, ccp);
   488		mutex_init(&ccp->mutex);
   489		init_completion(&ccp->wait_input_report);
   490	
   491		hid_device_io_start(hdev);
   492	
   493		/* temp and fan connection status only updates when device is powered on */
   494		ret = get_temp_cnct(ccp);
   495		if (ret)
   496			goto out_hw_close;
   497	
   498		ret = get_fan_cnct(ccp);
   499		if (ret)
   500			goto out_hw_close;
   501		ccp->hwmon_dev = hwmon_device_register_with_info(&hdev->dev, "corsaircpro",
 > 502								 ccp, &ccp_chip_info, 0);
   503		if (IS_ERR(ccp->hwmon_dev)) {
   504			ret = PTR_ERR(ccp->hwmon_dev);
   505			goto out_hw_close;
   506		}
   507	
   508		return 0;
   509	
   510	out_hw_close:
   511		hid_hw_close(hdev);
   512	out_hw_stop:
   513		hid_hw_stop(hdev);
   514		return ret;
   515	}
   516	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-09 20:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-09 20:52 drivers/hwmon/corsair-cpro.c:502:79: sparse: sparse: Using plain integer as NULL pointer kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox