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


Lad Prabhakar
 

Hi Nobuhiro,

-----Original Message-----
From: nobuhiro1.iwamatsu@... <nobuhiro1.iwamatsu@...>
Sent: 27 January 2022 09:40
To: pavel@...
Cc: Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@...>; cip-dev@...;
Biju Das <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,

-----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://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2F
lore.kernel.org%2Fall%2F20220106114801.20563-1-prabhakar.mahadev&a
mp;data=04%7C01%7Cprabhakar.mahadev-lad.rj%40bp.renesas.com%7C2a6a
f30f6f9344d87f0508d9e178f087%7C53d82571da1947e49cb4625a166a4a2a%7C
0%7C0%7C637788731814018904%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjA
wMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sda
ta=irBP96Ho%2F7f4miUJe5UxR1%2BfbWJmTI8XsLXzT9DLid4%3D&amp;reserved
=0
-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://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2F
gitlab.com%2Fcip-project%2Fcip-kernel%2Flinux-cip%2F-%2Fpipelines%
2F4571&amp;data=04%7C01%7Cprabhakar.mahadev-lad.rj%40bp.renesas.co
m%7C2a6af30f6f9344d87f0508d9e178f087%7C53d82571da1947e49cb4625a166
a4a2a%7C0%7C0%7C637788731814018904%7CUnknown%7CTWFpbGZsb3d8eyJWIjo
iMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000
&amp;sdata=Qpo7dEOIdMguVEP%2Bu6Hxcd5SKJrdD%2BVSjBtsc2XVd6Y%3D&amp;
reserved=0
23034
Looks good to me, go ahead :-).
Thanks, I pushed to git.kernel.org.
Thank you for the review and acceptance.

Cheers,
Prabhakar

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