Linux Serial subsystem development
 help / color / mirror / Atom feed
From: Nicolai Buchwitz <nb@tipi-net.de>
To: Dan Carpenter <dan@cryspen.com>
Cc: "Russell King" <linux@armlinux.org.uk>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	"Kartik Rajput" <kkartik@nvidia.com>,
	"Fan Wu" <fanwu01@zju.edu.cn>, "Frank Li" <Frank.Li@nxp.com>,
	"Karl Mehltretter" <kmehltretter@gmail.com>,
	"Stefan Dösinger" <stefandoesinger@gmail.com>,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH] serial: amba-pl011: Fix divide by zero in pl011_console_get_options()
Date: Thu, 12 Nov 2026 09:08:00 +0100	[thread overview]
Message-ID: <3726053453c5abac97e4fe90bf40d205@tipi-net.de> (raw)
In-Reply-To: <6fdea544b2fb8f4226e296a952331cd42684474d.1794315353.git.dan@cryspen.com>

Hi Dan

On 11.11.2026 10:23, Dan Carpenter wrote:
> When you boot QEMU with -kernel and don't set a baud rate the ibrd and
> fbrd values are zero and so clkdiv is also zero.  It results in a 
> divide
> by zero.  Most of the time people don't notice because on
> qemu-system-arm64 when you divide by zero the result is zero and
> everything works.  However, if you enable UBSAN, then the divide by 
> zero
> leads to a crash and the boot fails.
> 
> Return early when clkdev is zero.  This leaves the baud rate set to its

nit: clkdiv

> default value of 38400.
> 
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: stable@vger.kernel.org
> Signed-off-by: Dan Carpenter <dan@cryspen.com>

> [...]

Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>

Thanks,
Nicolai

      parent reply	other threads:[~2026-11-12  8:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11  9:23 [PATCH] serial: amba-pl011: Fix divide by zero in pl011_console_get_options() Dan Carpenter
2026-11-11  9:29 ` sashiko-bot
2026-11-12  8:08 ` Nicolai Buchwitz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3726053453c5abac97e4fe90bf40d205@tipi-net.de \
    --to=nb@tipi-net.de \
    --cc=Frank.Li@nxp.com \
    --cc=dan@cryspen.com \
    --cc=fanwu01@zju.edu.cn \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=kkartik@nvidia.com \
    --cc=kmehltretter@gmail.com \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=stefandoesinger@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox