Skip to content

Commit df63d3a

Browse files
committed
can: m_can: m_can_close(): don't call free_irq() for IRQ-less devices
JIRA: https://issues.redhat.com/browse/RHEL-90130 commit e4de81f Author: Marc Kleine-Budde <[email protected]> Date: Mon Sep 30 19:02:30 2024 +0200 can: m_can: m_can_close(): don't call free_irq() for IRQ-less devices In commit b382380 ("can: m_can: Add hrtimer to generate software interrupt") support for IRQ-less devices was added. Instead of an interrupt, the interrupt routine is called by a hrtimer-based polling loop. That patch forgot to change free_irq() to be only called for devices with IRQs. Fix this, by calling free_irq() conditionally only if an IRQ is available for the device (and thus has been requested previously). Fixes: b382380 ("can: m_can: Add hrtimer to generate software interrupt") Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Markus Schneider-Pargmann <[email protected]> Link: https://patch.msgid.link/[email protected] Cc: <[email protected]> # v6.6+ Signed-off-by: Marc Kleine-Budde <[email protected]> Signed-off-by: Radu Rendec <[email protected]>
1 parent 82b620d commit df63d3a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/can/m_can/m_can.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1724,7 +1724,8 @@ static int m_can_close(struct net_device *dev)
17241724
napi_disable(&cdev->napi);
17251725

17261726
m_can_stop(dev);
1727-
free_irq(dev->irq, dev);
1727+
if (dev->irq)
1728+
free_irq(dev->irq, dev);
17281729

17291730
m_can_clean(dev);
17301731

0 commit comments

Comments
 (0)