can: m_can: pci: add missing m_can_class_free_dev() in probe/remove methods
authorZhang Changzhong <zhangchangzhong@huawei.com>
Fri, 11 Nov 2022 12:11:23 +0000 (20:11 +0800)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 24 Nov 2022 15:10:18 +0000 (16:10 +0100)
commit1eca1d4cc21b6d0fc5f9a390339804c0afce9439
treeca3fd82d1c08d090011da347770c41ec2db6e1a2
parent709cb2f9ed2006eb1dc4b36b99d601cd24889ec4
can: m_can: pci: add missing m_can_class_free_dev() in probe/remove methods

In m_can_pci_remove() and error handling path of m_can_pci_probe(),
m_can_class_free_dev() should be called to free resource allocated by
m_can_class_allocate_dev(), otherwise there will be memleak.

Fixes: cab7ffc0324f ("can: m_can: add PCI glue driver for Intel Elkhart Lake")
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Link: https://lore.kernel.org/all/1668168684-6390-1-git-send-email-zhangchangzhong@huawei.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/m_can/m_can_pci.c