Skip to contentSkip to conversation

pcmcia: bcm63xx: unregister socket before freeing it

PATCH New Avi Weiss 1 participant 1 message Oct 27 Pcmcia

lore
Share & tools
lore

Avi Weiss

author
#0 lore raw

PATCH 1/1 pcmcia: bcm63xx: unregister socket before freeing it

bcm63xx_drv_pcmcia_remove() stops the polling timer and frees the socket without unregistering it from the PCMCIA core. This leaves the socket on the core's list with its thread and device still active, referencing freed driver state.

Unregister the socket after stopping the timer and before releasing its resources.

Fixes 553d6d5f5b84 ("MIPS: BCM63xx: Add PCMCIA & Cardbus support.")

---

 1 file changed, 1 insertion(+)
drivers/pcmcia/bcm63xx_pcmcia.c +1 -0
index 1612b5d76975..275593a2852c 100644
@@ -444,6 +444,7 @@ static void bcm63xx_drv_pcmcia_remove(struct platform_device *pdev)
 
 	skt = platform_get_drvdata(pdev);
 	timer_shutdown_sync(&skt->timer);
+	pcmcia_unregister_socket(&skt->socket);
 	iounmap(skt->base);
 	iounmap(skt->io_base);
 	res = skt->reg_res;

base-commit: d135ab453a7400a34930bdda1ef4bdc8acfac80e

Signature · 1 line
2.43.0