[Intel-wired-lan] [bug report] ice: implement dpll interface to control cgu
Dan Carpenter
dan.carpenter at linaro.org
Tue Jan 23 10:00:42 UTC 2024
Hello Arkadiusz Kubalewski,
The patch d7999f5ea64b: "ice: implement dpll interface to control
cgu" from Sep 13, 2023 (linux-next), leads to the following Smatch
static checker warning:
drivers/net/ethernet/intel/ice/ice_dpll.c:1590 ice_dpll_init_rclk_pins()
warn: inconsistent refcounting 'pf->dplls.rclk.pin->refcount.refs.counter':
drivers/net/ethernet/intel/ice/ice_dpll.c
1554 static int
1555 ice_dpll_init_rclk_pins(struct ice_pf *pf, struct ice_dpll_pin *pin,
1556 int start_idx, const struct dpll_pin_ops *ops)
1557 {
1558 struct ice_vsi *vsi = ice_get_main_vsi(pf);
1559 struct dpll_pin *parent;
1560 int ret, i;
1561
1562 ret = ice_dpll_get_pins(pf, pin, start_idx, ICE_DPLL_RCLK_NUM_PER_PF,
1563 pf->dplls.clock_id);
1564 if (ret)
1565 return ret;
1566 for (i = 0; i < pf->dplls.rclk.num_parents; i++) {
1567 parent = pf->dplls.inputs[pf->dplls.rclk.parent_idx[i]].pin;
1568 if (!parent) {
1569 ret = -ENODEV;
1570 goto unregister_pins;
1571 }
1572 ret = dpll_pin_on_pin_register(parent, pf->dplls.rclk.pin,
1573 ops, &pf->dplls.rclk);
1574 if (ret)
1575 goto unregister_pins;
1576 }
1577 if (WARN_ON((!vsi || !vsi->netdev)))
1578 return -EINVAL;
goto unregister_pins?
1579 netdev_dpll_pin_set(vsi->netdev, pf->dplls.rclk.pin);
1580
1581 return 0;
1582
1583 unregister_pins:
1584 while (i) {
1585 parent = pf->dplls.inputs[pf->dplls.rclk.parent_idx[--i]].pin;
1586 dpll_pin_on_pin_unregister(parent, pf->dplls.rclk.pin,
1587 &ice_dpll_rclk_ops, &pf->dplls.rclk);
1588 }
1589 ice_dpll_release_pins(pin, ICE_DPLL_RCLK_NUM_PER_PF);
--> 1590 return ret;
1591 }
regards,
dan carpenter
More information about the Intel-wired-lan
mailing list