From nobody Mon Jun 15 12:22:43 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E729313D638; Tue, 21 Apr 2026 06:57:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776754672; cv=none; b=obxAhdOlp6hJjubuWDZ/i8ZQyGupEEAMuY52Fxhqx5nbvhbx5lwDV96fsp2kWvXq2LF+QdcjrPkAgq0UzCNqq+axTZuBFGF1ulHAqhexUZYUo8cHrPOjqgPrYutbOEIrkr8bXQhUhOfZOPUi6LgB6UIFZUfI1e2+d4i2+e37w0M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776754672; c=relaxed/simple; bh=1zwz5A6eK27rY7E/1sFnkyfDpzSOTKGKankh+8431SM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=aerCW908mGjwlZ6iHN7tvov7jR0cK/v1QZnyMQlpVO33RwuwWIJN6PEtlCym0DNpozLHPhi1uOFePbM47Scxk91AwCvzvuZ1Ty+UjnioM5KpMe0S4g+cFenOvuV0lFxders4kybTyge282jCdFnK0JiGC/2y2NytaRFBFHh4f0A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 645ab7003d4f11f1aa26b74ffac11d73-20260421 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:7bf56828-2495-4518-a262-f54383f2d90b,IP:0,U RL:0,TC:0,Content:-5,EDM:25,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:20 X-CID-META: VersionHash:e7bac3a,CLOUDID:7509b3cb8611d57df4494809f61a7a4c,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:102|850|898,TC:nil,Content:0|15|50,EDM:5 ,IP:nil,URL:99|1,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0 ,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULS X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 645ab7003d4f11f1aa26b74ffac11d73-20260421 X-User: zenghongling@kylinos.cn Received: from localhost.localdomain [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 470018249; Tue, 21 Apr 2026 14:57:42 +0800 From: Hongling Zeng To: gregkh@linuxfoundation.org, jirislaby@kernel.org, geert+renesas@glider.be, biju.das.jz@bp.renesas.com, wsa+renesas@sang-engineering.com, thierry.bultel.yh@bp.renesas.com, prabhakar.mahadev-lad.rj@bp.renesas.com Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, zhongling0719@126.com, Hongling Zeng , kernel test robot , Dan Carpenter Subject: [PATCH v3] serial: sh-sci: fix memory region release in error path Date: Tue, 21 Apr 2026 14:57:37 +0800 Message-Id: <20260421065737.724187-1-zenghongling@kylinos.cn> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 reserva= tions.") Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202604032356.SzEjYkBC-lkp@intel.com/ Signed-off-by: Hongling Zeng Reviewed-by: Geert Uytterhoeven --- Change in v3: - Per review, fix the commit message. - Fix name. --- --- 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) =20 ret =3D sci_remap_port(port); if (unlikely(ret !=3D 0)) { - release_resource(res); + release_mem_region(port->mapbase, sport->reg_size); return ret; } =20 --=20 2.25.1