[PATCH] pcmcia: rsrc_nonstatic: fix invalid iounmap warning on card insertion

From: Luc Bertho

Date: Wed Nov 04 2026 - 16:32:10 EST


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 <luc.bertho.kernel@xxxxxxxxx>
---

--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -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))