public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] serial: sh-sci: fix memory region release in error path
@ 2026-04-21  6:38 Hongling Zeng
  2026-04-21  6:43 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Hongling Zeng @ 2026-04-21  6:38 UTC (permalink / raw)
  To: gregkh, jirislaby, geert+renesas, biju.das.jz, wsa+renesas,
	thierry.bultel.yh, prabhakar.mahadev-lad.rj
  Cc: linux-kernel, linux-serial, zhongling0719, zenghongling,
	kernel test robot, Dan Carpenter

From: zenghongling <zenghongling@kylinos.cn>

The sci_request_port() function uses request_mem_region() to reserve
I/O memory, but in the error path when sci_remap_port() fails, it
incorrectly calls release_resource() instead of release_mem_region().

This mismatch can cause resource accounting issues. Fix it by using
the correct release function, consistent with sci_release_port().

Fixes: e2651647080930a1 ("serial: sh-sci: Handle port memory region reservations.")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/r/202604032356.SzEjYkBC-lkp@intel.com/
Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

---
Change in v2:
  - Per review, fix the commit message
---
---
 drivers/tty/serial/sh-sci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 6c819b6b2425..54db019a5bfc 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -3025,7 +3025,7 @@ int sci_request_port(struct uart_port *port)
 
 	ret = sci_remap_port(port);
 	if (unlikely(ret != 0)) {
-		release_resource(res);
+		release_mem_region(port->mapbase, sport->reg_size);
 		return ret;
 	}
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] serial: sh-sci: fix memory region release in error path
  2026-04-21  6:38 [PATCH v2] serial: sh-sci: fix memory region release in error path Hongling Zeng
@ 2026-04-21  6:43 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2026-04-21  6:43 UTC (permalink / raw)
  To: Hongling Zeng
  Cc: jirislaby, geert+renesas, biju.das.jz, wsa+renesas,
	thierry.bultel.yh, prabhakar.mahadev-lad.rj, linux-kernel,
	linux-serial, zhongling0719, kernel test robot, Dan Carpenter

On Tue, Apr 21, 2026 at 02:38:19PM +0800, Hongling Zeng wrote:
> From: zenghongling <zenghongling@kylinos.cn>

This needs to match the name you used in your signed-off-by: line.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-21  6:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-21  6:38 [PATCH v2] serial: sh-sci: fix memory region release in error path Hongling Zeng
2026-04-21  6:43 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox