Re: [PATCH 5.10.y-cip] can: rcar_canfd: rcar_canfd_channel_probe(): make sure we free CAN network device


Nobuhiro Iwamatsu
 

Hi,

-----Original Message-----
From: Pavel Machek <pavel@...>
Sent: Thursday, January 27, 2022 7:05 AM
To: iwamatsu nobuhiro(岩松 信洋 □SWC◯ACT)
<nobuhiro1.iwamatsu@...>
Cc: prabhakar.mahadev-lad.rj@...; cip-dev@...;
pavel@...; biju.das.jz@...
Subject: Re: [PATCH 5.10.y-cip] can: rcar_canfd: rcar_canfd_channel_probe():
make sure we free CAN network device

Hi!

make sure we free CAN network device

commit 72b1e360572f9fa7d08ee554f1da29abce23f288 upstream.

Make sure we free CAN network device in the error path. There are
several jumps to fail label after allocating the CAN network device
successfully. This patch places the free_candev() under fail label
so that in failure path a jump to fail label frees the CAN network device.

Fixes: 76e9353a80e9 ("can: rcar_canfd: Add support for RZ/G2L
family")
Link:
https://lore.kernel.org/all/20220106114801.20563-1-prabhakar.mahadev
-lad.r
j@...
Reported-by: Pavel Machek <pavel@...>
Signed-off-by: Lad Prabhakar
<prabhakar.mahadev-lad.rj@...>
Reviewed-by: Kieran Bingham
<kieran.bingham+renesas@...>
Signed-off-by: Marc Kleine-Budde <mkl@...>
Signed-off-by: Lad Prabhakar
<prabhakar.mahadev-lad.rj@...>
---
drivers/net/can/rcar/rcar_canfd.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
LGTM.
If there is no other opinion, I can apply this.
Test:
https://gitlab.com/cip-project/cip-kernel/linux-cip/-/pipelines/4571
23034
Looks good to me, go ahead :-).
Thanks, I pushed to git.kernel.org.


Best regards,
Pavel
Best regards,
Nobuhiro

Join cip-dev@lists.cip-project.org to automatically receive all group messages.