pcmcia: rsrc_nonstatic: fix invalid iounmap warning on card insertion
PATCH 1/1 pcmcia: rsrc_nonstatic: fix invalid iounmap warning on card insertion
When inserting a CompactFlash card via a PCMCIA adapter on a Dell Latitude, the pccardd daemon triggers a WARNING in iounmap() on recent kernels (>= 6.12) because it attempts to unmap an address that may have already been released or tracking context has shifted.
Fix this by explicitly checking if s->cis_virt is valid before invoking iounmap().
Signed-off-by Luc Bertho <[email protected]>
---
drivers/pcmcia/rsrc_nonstatic.c +4 -2
@@ -279,8 +279,10 @@ ret = s->callback->validate (s, count);/* invalidate mapping */ mutex_lock (&s->ops_mutex); -iounmap (s->cis_virt); - s->cis_virt =NULL ; +if (s->cis_virt) { +iounmap (s->cis_virt); + s->cis_virt =NULL ; + } } s->cis_mem.res =NULL ;if ((ret) || (*count ==0 ))