From: Horatiu Vultur <horatiu.vultur@microchip.com>
To: "Clément Léger" <clement.leger@bootlin.com>
Cc: <UNGLinuxDriver@microchip.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
Richard Cochran <richardcochran@gmail.com>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: lan966x: check for ptp to be enabled in lan966x_ptp_deinit()
Date: Fri, 6 Jan 2023 21:21:48 +0100 [thread overview]
Message-ID: <20230106202148.77gkauaikjhyjcvi@soft-dev3-1> (raw)
In-Reply-To: <20230106134830.333494-1-clement.leger@bootlin.com>
The 01/06/2023 14:48, Clément Léger wrote:
Hi Clement,
>
> If ptp was not enabled due to missing IRQ for instance,
> lan966x_ptp_deinit() will dereference NULL pointers.
>
> Fixes: d096459494a8 ("net: lan966x: Add support for ptp clocks")
> Signed-off-by: Clément Léger <clement.leger@bootlin.com>
You forgot to mark the patch to target the net tree. But other
than that looks good.
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> ---
> drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c b/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c
> index f9ebfaafbebc..a8348437dd87 100644
> --- a/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c
> +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c
> @@ -1073,6 +1073,9 @@ void lan966x_ptp_deinit(struct lan966x *lan966x)
> struct lan966x_port *port;
> int i;
>
> + if (!lan966x->ptp)
> + return;
> +
> for (i = 0; i < lan966x->num_phys_ports; i++) {
> port = lan966x->ports[i];
> if (!port)
> --
> 2.38.1
>
--
/Horatiu
next prev parent reply other threads:[~2023-01-06 20:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-06 13:48 [PATCH] net: lan966x: check for ptp to be enabled in lan966x_ptp_deinit() Clément Léger
2023-01-06 20:21 ` Horatiu Vultur [this message]
2023-01-06 20:24 ` clement.leger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230106202148.77gkauaikjhyjcvi@soft-dev3-1 \
--to=horatiu.vultur@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=clement.leger@bootlin.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).