Skip to content

Commit e4de81f

Browse files
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]>
1 parent 7b22846 commit e4de81f

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
@@ -1765,7 +1765,8 @@ static int m_can_close(struct net_device *dev)
17651765
netif_stop_queue(dev);
17661766

17671767
m_can_stop(dev);
1768-
free_irq(dev->irq, dev);
1768+
if (dev->irq)
1769+
free_irq(dev->irq, dev);
17691770

17701771
m_can_clean(dev);
17711772

0 commit comments

Comments
 (0)