[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202111141927.IlfNmswF-lkp@intel.com>
Date: Sun, 14 Nov 2021 19:57:31 +0800
From: kernel test robot <lkp@...el.com>
To: Wilken Gottwalt <wilken.gottwalt@...teo.net>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
Guenter Roeck <linux@...ck-us.net>
Subject: drivers/hwmon/corsair-psu.c:536:82: sparse: sparse: Using plain
integer as NULL pointer
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c8c109546a19613d323a319d0c921cb1f317e629
commit: d115b51e0e567199c821fc39e13b6af7e78f247d hwmon: add Corsair PSU HID controller driver
date: 12 months ago
config: riscv-randconfig-s031-20211109 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d115b51e0e567199c821fc39e13b6af7e78f247d
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout d115b51e0e567199c821fc39e13b6af7e78f247d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv SHELL=/bin/bash block/ drivers/hid/ drivers/hwmon/ drivers/i2c/busses/ drivers/message/fusion/ drivers/net/ethernet/ drivers/net/wireless/intel/iwlwifi/ drivers/pci/ drivers/remoteproc/ drivers/rtc/ drivers/staging/rts5208/ drivers/staging/vc04_services/ drivers/tty/serial/ drivers/vdpa/ drivers/video/fbdev/ net/qrtr/ net/sched/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/hwmon/corsair-psu.c:536:82: sparse: sparse: Using plain integer as NULL pointer
vim +536 drivers/hwmon/corsair-psu.c
490
491 static int corsairpsu_probe(struct hid_device *hdev, const struct hid_device_id *id)
492 {
493 struct corsairpsu_data *priv;
494 int ret;
495
496 priv = devm_kzalloc(&hdev->dev, sizeof(struct corsairpsu_data), GFP_KERNEL);
497 if (!priv)
498 return -ENOMEM;
499
500 priv->cmd_buffer = devm_kmalloc(&hdev->dev, CMD_BUFFER_SIZE, GFP_KERNEL);
501 if (!priv->cmd_buffer)
502 return -ENOMEM;
503
504 ret = hid_parse(hdev);
505 if (ret)
506 return ret;
507
508 ret = hid_hw_start(hdev, HID_CONNECT_HIDRAW);
509 if (ret)
510 return ret;
511
512 ret = hid_hw_open(hdev);
513 if (ret)
514 goto fail_and_stop;
515
516 priv->hdev = hdev;
517 hid_set_drvdata(hdev, priv);
518 mutex_init(&priv->lock);
519 init_completion(&priv->wait_completion);
520
521 hid_device_io_start(hdev);
522
523 ret = corsairpsu_init(priv);
524 if (ret < 0) {
525 dev_err(&hdev->dev, "unable to initialize device (%d)\n", ret);
526 goto fail_and_stop;
527 }
528
529 ret = corsairpsu_fwinfo(priv);
530 if (ret < 0) {
531 dev_err(&hdev->dev, "unable to query firmware (%d)\n", ret);
532 goto fail_and_stop;
533 }
534
535 priv->hwmon_dev = hwmon_device_register_with_info(&hdev->dev, "corsairpsu", priv,
> 536 &corsairpsu_chip_info, 0);
537
538 if (IS_ERR(priv->hwmon_dev)) {
539 ret = PTR_ERR(priv->hwmon_dev);
540 goto fail_and_close;
541 }
542
543 corsairpsu_debugfs_init(priv);
544
545 return 0;
546
547 fail_and_close:
548 hid_hw_close(hdev);
549 fail_and_stop:
550 hid_hw_stop(hdev);
551 return ret;
552 }
553
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (39597 bytes)
Powered by blists - more mailing lists