Thread (5 messages) flat view 5 messages, 2 authors, 13d ago

Re: [PATCH v2] net: 8390: pcnet_cs: release PCMCIA window on setup_shmem_window() error

From: Myeonghun Pak <hidden>
Date: 2026-09-13 20:37:31
Also in: lkml, stable

Thanks for the review. I'll drop the Fixes and stable Cc tags in v3.

2026년 9월 13일 (일) 오전 10:32, Simon Horman [off-list ref]님이 작성:
On Thu, Sep 10, 2026 at 07:14:00PM -0400, Myeonghun Pak wrote:
quoted
setup_shmem_window() acquires a PCMCIA memory window using
pcmcia_request_window(). If pcmcia_map_mem_page() or the subsequent
ioremap() fails, the function returns without releasing the requested
window.

pcnet_config() treats shared-memory setup failure as non-fatal and falls
back to setup_dma_config(). Probe can therefore continue while socket
window 3 and its reserved iomem range remain unnecessarily held for the
rest of the bound lifetime of the device. pcmcia_disable_device()
eventually releases the window during teardown.

Route error paths after a successful request through a new release label
that calls pcmcia_release_window(). Fold the existing buffer-verification
cleanup into the same path, keeping iounmap() before the window release
when a mapping exists. Leave the request failure path unchanged.

This issue was identified during our ongoing static-analysis research while
reviewing kernel code.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
As pointed out by the AI-Generated review of this patch at
https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260910231400.31919-1-mhun512%40gmail.com
This patch seems to be more of a cleanup than a bug fix - as noted above in
the patch description, the resources are eventually released anyway.

So I wonder if the Fixes and CC to stable should be dropped.
quoted
Assisted-by: OpenAI:GPT-5.6
Co-developed-by: Ijae Kim <redacted>
Signed-off-by: Ijae Kim <redacted>
Signed-off-by: Myeonghun Pak <redacted>
---
Changes in v2:
- Clarify that the window remains reserved only until device teardown.
- Make the DMA fallback and continued probe description conditional.
- Avoid claiming that every request failure leaves no resource held.
- Restore the surrounding indentation for the new goto statements.

Link: https://lore.kernel.org/netdev/20260731161740.44955-1-mhun512@gmail.com/ (local)
The process nit above notwithstanding, this patch looks good to me.

Reviewed-by: Simon Horman <horms@kernel.org>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help