Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 4C2923EDAAE for ; Thu, 4 Jun 2026 10:53:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780570400; cv=none; b=trJLF3CWcSMebHLMvtGIzQNRPD5K4TNNCRkShXh3vsWQugNrMb1eunaGUJZpEiW/JT2ly3m+T+hoF+nZtZOqrlUFM5Qg07/Sm2IBw4Hb8RS780Y8tkFDcm9WrrfYVEdFfm7tLqyTVrldKwCJjItpptuOopW4g4aUjweMgoD8DVk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780570400; c=relaxed/simple; bh=HRMJTGBayZFaI5ShAsh+D8+Ve94vjElKcAs+t/ivjjo=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=j514xd4hleubqar07Mx5076QHiF6AOCkZCu36hUXYg9FkSeYDAfWG45GXrmSIUVkxR1g0PUYz4uyRuuD4faasSpsl7NseawilsKMYXzresJlKy+n6IdPPgCucEoknfFjD8bbZgABC8NouybBCWNDH1nv/FOWUEOD3nZSgpnaudQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ayk0aVLm; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Ayk0aVLm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B4141F00893; Thu, 4 Jun 2026 10:53:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780570399; bh=U+RTYAbJHGZBHmd8pw5DvH/Z1SrqdielB/wuIz8tQOo=; h=Subject:To:Cc:From:Date; b=Ayk0aVLmrgWMXrwGzSaw8g66lDabPdWPIb4Ub24+faqeGPgSLTBbh71KFofJ7ywYJ xT3py7UJ1QNemjgD7MksLCz7izxE/Y7ha/jPL374T8Yp9jYIUXBqtN9CW0oKI/Xh0H Ar1vBOzQaHqF8se5frOzSqbnB0/ow/gWbKvhZLwE= Subject: FAILED: patch "[PATCH] serial: altera_jtaguart: handle uart_add_one_port() failures" failed to apply to 5.15-stable tree To: mhun512@gmail.com,ae878000@gmail.com,gregkh@linuxfoundation.org,stable@kernel.org Cc: From: Date: Thu, 04 Jun 2026 12:52:22 +0200 Message-ID: <2026060422-eskimo-docile-6e8f@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x ea66be25f0e934f49d24cd0c5845d13cdba3520b # git commit -s git send-email --to '' --in-reply-to '2026060422-eskimo-docile-6e8f@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ From ea66be25f0e934f49d24cd0c5845d13cdba3520b Mon Sep 17 00:00:00 2001 From: Myeonghun Pak Date: Tue, 12 May 2026 15:56:57 +0900 Subject: [PATCH] serial: altera_jtaguart: handle uart_add_one_port() failures altera_jtaguart_probe() maps the register window before registering the UART port, but it ignores failures from uart_add_one_port(). If port registration fails, probe still returns success and the mapping remains live until a later remove path that is not part of probe failure cleanup. Return the uart_add_one_port() error and unmap the register window on that failure path. This issue was identified during our ongoing static-analysis research while reviewing kernel code. Fixes: 5bcd601049c6 ("serial: Add driver for the Altera JTAG UART") Cc: stable Co-developed-by: Ijae Kim Signed-off-by: Ijae Kim Signed-off-by: Myeonghun Pak Link: https://patch.msgid.link/20260512065837.79528-1-mhun512@gmail.com Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c index d47a62d1c9f7..20f079fe11d8 100644 --- a/drivers/tty/serial/altera_jtaguart.c +++ b/drivers/tty/serial/altera_jtaguart.c @@ -379,6 +379,7 @@ static int altera_jtaguart_probe(struct platform_device *pdev) struct resource *res_mem; int i = pdev->id; int irq; + int ret; /* -1 emphasizes that the platform must have one port, no .N suffix */ if (i == -1) @@ -418,7 +419,11 @@ static int altera_jtaguart_probe(struct platform_device *pdev) port->flags = UPF_BOOT_AUTOCONF; port->dev = &pdev->dev; - uart_add_one_port(&altera_jtaguart_driver, port); + ret = uart_add_one_port(&altera_jtaguart_driver, port); + if (ret) { + iounmap(port->membase); + return ret; + } return 0; }