public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Marius Zachmann <mail@mariuszachmann.de>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Guenter Roeck <linux@roeck-us.net>
Subject: drivers/hwmon/corsair-cpro.c:502:79: sparse: sparse: Using plain integer as NULL pointer
Date: Sun, 10 Dec 2023 04:52:12 +0800	[thread overview]
Message-ID: <202312100455.k6m2eO4N-lkp@intel.com> (raw)

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

                 reply	other threads:[~2023-12-09 20:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202312100455.k6m2eO4N-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mail@mariuszachmann.de \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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