[thomas-weissschuh:b4/cros_ec-hwmon-locking 2/6] drivers/hwmon/cros_ec_hwmon.c:578 cros_ec_hwmon_probe() warn: passing zero to 'PTR_ERR'
Dan Carpenter <[email protected]>
| Newsgroups | dev.linux.lists.oe-kbuild |
|---|---|
| Message-ID | <20260709103714.VgCV9Zd3JTMXRriEwzwmi7nnuPH7nIgrSvm-t7wJqvE@z> |
tree: https://git.kernel.org/pub/scm/linux/kernel/git/thomas.weissschuh/linux.git b4/cros_ec-hwmon-locking head: 95003896306434c5e2d6cae819f38179e0f5048f commit: d54d63ebb10e19d82a484c16372173926c021022 [2/6] priv config: sparc-randconfig-r071-20260702 (https://download.01.org/0day-ci/archive/20260703/[email protected]/config) compiler: sparc64-linux-gcc (GCC) 13.4.0 smatch: v0.5.0-9185-gbcc58b9c 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 protected]> | Reported-by: Dan Carpenter <[email protected]> | Closes: https://lore.kernel.org/r/[email protected]/ smatch warnings: drivers/hwmon/cros_ec_hwmon.c:578 cros_ec_hwmon_probe() warn: passing zero to 'PTR_ERR' vim +/PTR_ERR +578 drivers/hwmon/cros_ec_hwmon.c bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 546 static int cros_ec_hwmon_probe(struct platform_device *pdev) bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 547 { bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 548 struct device *dev = &pdev->dev; bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 549 struct cros_ec_dev *ec_dev = dev_get_drvdata(dev->parent); bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 550 struct cros_ec_device *cros_ec = ec_dev->ec_dev; bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 551 struct cros_ec_hwmon_priv *priv; bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 552 struct device *hwmon_dev; bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 553 u8 thermal_version; bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 554 int ret; bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 555 bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 556 ret = cros_ec_cmd_readmem(cros_ec, EC_MEMMAP_THERMAL_VERSION, 1, &thermal_version); bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 557 if (ret < 0) bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 558 return ret; bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 559 bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 560 /* Covers both fan and temp sensors */ bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 561 if (thermal_version == 0) bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 562 return -ENODEV; bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 563 bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 564 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 565 if (!priv) bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 566 return -ENOMEM; bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 567 bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 568 priv->cros_ec = cros_ec; bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 569 bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 570 cros_ec_hwmon_probe_temp_sensors(dev, priv, thermal_version); bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 571 cros_ec_hwmon_probe_fans(priv); fb8e659309f72e Sung-Chi Li 2025-09-11 572 priv->fan_control_supported = cros_ec_hwmon_probe_fan_control_supported(priv->cros_ec); afa7c56ec44731 Thomas WeiÃschuh 2026-01-18 573 priv->temp_threshold_supported = is_cros_ec_cmd_available(priv->cros_ec, afa7c56ec44731 Thomas WeiÃschuh 2026-01-18 574 EC_CMD_THERMAL_GET_THRESHOLD, 1); bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 575 d54d63ebb10e19 Thomas WeiÃschuh 2026-07-01 576 priv->hwmon_dev = devm_hwmon_device_register_with_info(dev, "cros_ec", priv, bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 577 &cros_ec_hwmon_chip_info, NULL); d54d63ebb10e19 Thomas WeiÃschuh 2026-07-01 @578 if (PTR_ERR(priv->hwmon_dev)) s/PTR_ERR/IS_ERR/ d54d63ebb10e19 Thomas WeiÃschuh 2026-07-01 579 return PTR_ERR(priv->hwmon_dev); d54d63ebb10e19 Thomas WeiÃschuh 2026-07-01 580 d54d63ebb10e19 Thomas WeiÃschuh 2026-07-01 581 cros_ec_hwmon_register_fan_cooling_devices(dev, priv); d54d63ebb10e19 Thomas WeiÃschuh 2026-07-01 582 fb8e659309f72e Sung-Chi Li 2025-09-11 583 platform_set_drvdata(pdev, priv); bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 584 bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 585 return PTR_ERR_OR_ZERO(hwmon_dev); bc3e45258096f2 Thomas WeiÃschuh 2024-05-29 586 } -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki