[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z1kv0tJHtoGVGmxO@hoboy.vegasvil.org>
Date: Tue, 10 Dec 2024 22:23:14 -0800
From: Richard Cochran <richardcochran@...il.com>
To: Ma Ke <make_ruc2021@....com>
Cc: andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, vdronov@...hat.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH] ptp: Check dev_set_name() return value
On Wed, Dec 11, 2024 at 10:26:12AM +0800, Ma Ke wrote:
> diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
> index 77a36e7bddd5..82405c07be3e 100644
> --- a/drivers/ptp/ptp_clock.c
> +++ b/drivers/ptp/ptp_clock.c
> @@ -348,7 +348,9 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
> ptp->dev.groups = ptp->pin_attr_groups;
> ptp->dev.release = ptp_clock_release;
> dev_set_drvdata(&ptp->dev, ptp);
> - dev_set_name(&ptp->dev, "ptp%d", ptp->index);
> + err = dev_set_name(&ptp->dev, "ptp%d", ptp->index);
> + if (err)
> + goto no_pps;
NAK
This fails to clean up by calling pps_unregister_source() on the error path.
Thanks,
Richard
Powered by blists - more mailing lists