]> git.baikalelectronics.ru Git - kernel.git/commit
can: rcar_canfd: rcar_canfd_channel_probe(): make sure we free CAN network device
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Thu, 6 Jan 2022 11:48:00 +0000 (11:48 +0000)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sun, 9 Jan 2022 12:32:28 +0000 (13:32 +0100)
commit36f77e18d4b7f77dd4b76d351c84035f1d925a3e
tree61c2fc8a2ad0be07b90f207690582043d2cfac2e
parent7cfeec89a0e4e9ab8893960ef2aa7fa89012ae9a
can: rcar_canfd: rcar_canfd_channel_probe(): make sure we free CAN network device

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: 53f37e24dc63 ("can: rcar_canfd: Add support for RZ/G2L family")
Link: https://lore.kernel.org/all/20220106114801.20563-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Reported-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/rcar/rcar_canfd.c