From nobody Tue Jun 16 20:40:35 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 D4A8935F61A; Tue, 21 Apr 2026 06:38:31 +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=1776753516; cv=none; b=S2vkb6sDRTzYtel3R90CGQaBDZQZfKLhPZOP20fVzwrGQPdhx0C1m+1U/r5IteYpJjLMjuokJRC3/oL3tYnSt/hcouxblHkMIAEDKs2JWQM1nVU9nyjwaDgK4XNKZH9vD0grHHBscKaRhTAZeUC4lrJ70Yb3ltbZPUzp9zl5ljI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776753516; c=relaxed/simple; bh=h6OpIdARxc6oImkrwAQL3zG4AaSb6Sfecqfh6gfksfE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Wxp/xq/ASHjxsGhg/6rA8OZWi73GTWx9tWUf0RWOuhoBo1yoVNpIMSyGeHSb8Ynl0ZC7+0yk/xlv7ur9zebNpW/p+znfPg1m3qcfyChEdldRA9FAb+7/vgZe1x9I2bBgvEDWUXz9csqSgVcuKLLDSzeA6GJdnYSojWV9Jhqpi7U= 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: b1f5b3c83d4c11f1aa26b74ffac11d73-20260421 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:8e0ff8ac-721d-42af-8ba0-369626c35284,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:d54fe867438a4e4a53b2c0d874a38987,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: b1f5b3c83d4c11f1aa26b74ffac11d73-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 2111556678; Tue, 21 Apr 2026 14:38:23 +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, zenghongling , kernel test robot , Dan Carpenter Subject: [PATCH v2] serial: sh-sci: fix memory region release in error path Date: Tue, 21 Apr 2026 14:38:19 +0800 Message-Id: <20260421063819.715295-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" From: zenghongling 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 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) =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