>From: Simon Horman <[email protected]>
>Sent: Thursday, August 28, 2025 12:33 PM
>
>On Tue, Aug 26, 2025 at 05:31:18PM +0200, Arkadiusz Kubalewski wrote:
>
>...
>
>> diff --git a/drivers/net/ethernet/intel/ice/ice_dpll.c
>> b/drivers/net/ethernet/intel/ice/ice_dpll.c
>
>...
>
>> +/**
>> + * ice_dpll_init_info_unmanaged - init dpll information for unmanaged
>> +dpll
>> + * @pf: board private structure
>> + *
>> + * Acquire (from HW) and set basic dpll information (on pf->dplls
>>struct).
>> + * For unmanaged dpll mode.
>> + *
>> + * Return:
>> + * * 0 - success
>> + * * negative - init failure reason
>> + */
>> +static int ice_dpll_init_info_unmanaged(struct ice_pf *pf) {
>> +    struct ice_dplls *d = &pf->dplls;
>> +    struct ice_dpll *de = &d->eec;
>> +    int ret = 0;
>> +
>> +    d->clock_id = ice_generate_clock_id(pf);
>> +    d->num_inputs = ice_cgu_get_pin_num(&pf->hw, true);
>> +    d->num_outputs = ice_cgu_get_pin_num(&pf->hw, false);
>> +    ice_dpll_lock_state_init_unmanaged(pf);
>> +
>> +    d->inputs = kcalloc(d->num_inputs, sizeof(*d->inputs), GFP_KERNEL);
>> +    if (!d->inputs)
>> +            return -ENOMEM;
>> +
>> +    ret = ice_dpll_init_pins_info(pf, ICE_DPLL_PIN_TYPE_INPUT);
>> +    if (ret)
>> +            goto deinit_info;
>> +
>> +    d->outputs = kcalloc(d->num_outputs, sizeof(*d->outputs),
>>GFP_KERNEL);
>> +    if (!d->outputs)
>
>Hi Arkadiusz,
>
>I think the following is needed here:
>
>               err = -ENOMEM;
>
>Flagged by Smatch.
>

Hi Simon,

Correct, will fix.

Thank you!
Arkadiusz

>> +            goto deinit_info;
>> +
>> +    ret = ice_dpll_init_pins_info(pf, ICE_DPLL_PIN_TYPE_OUTPUT);
>> +    if (ret)
>> +            goto deinit_info;
>> +
>> +    de->mode = DPLL_MODE_AUTOMATIC;
>> +    dev_dbg(ice_pf_to_dev(pf), "%s - success, inputs:%u, outputs:%u\n",
>> +            __func__, d->num_inputs, d->num_outputs);
>> +    return 0;
>> +deinit_info:
>> +    dev_err(ice_pf_to_dev(pf), "%s - fail: d->inputs:%p, d-
>>outputs:%p\n",
>> +            __func__, d->inputs, d->outputs);
>> +    ice_dpll_deinit_info(pf);
>> +    return ret;
>> +}
>
>...

Reply via email to