The condition to call free_irq() in the error cleanup path of m_can_open() can be simplified. The "is_peripheral" case also has a "dev->irq != 0". Simplify the condition, call free_irq() if "dev->irq != 0", i.e. the device has an interrupt. Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> --- drivers/net/can/m_can/m_can.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index a978b960f1f1e1e8273216ff330ab789d0fd6d51..66a8673e51eab8c901434de16c640045f7d0dd70 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -2070,7 +2070,7 @@ static int m_can_open(struct net_device *dev) return 0; exit_start_fail: - if (cdev->is_peripheral || dev->irq) + if (dev->irq) free_irq(dev->irq, dev); exit_irq_fail: if (cdev->is_peripheral) --- base-commit: c824deb1a89755f70156b5cdaf569fca80698719 change-id: 20240930-m_can-simplify-f50760775f3b Best regards, -- Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>