From: Luc Bertho <luc.bertho.kernel@gmail.com>
To: linux@dominikbrodowski.net
Cc: linux-kernel@vger.kernel.org, Luc Bertho <luc.bertho.kernel@gmail.com>
Subject: [PATCH] pcmcia: rsrc_nonstatic: fix invalid iounmap warning on card insertion
Date: Wed, 4 Nov 2026 20:15:21 +0100 [thread overview]
Message-ID: <20261104191521.19857-1-luc.bertho.kernel@gmail.com> (raw)
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@gmail.com>
---
--- 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))
reply other threads:[~2026-11-04 19:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261104191521.19857-1-luc.bertho.kernel@gmail.com \
--to=luc.bertho.kernel@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@dominikbrodowski.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®