From: Jacky Huang <ychuang570808@gmail.com>
To: Chen Ni <nichen@iscas.ac.cn>,
ychuang3@nuvoton.com, schung@nuvoton.com,
gregkh@linuxfoundation.org, jirislaby@kernel.org,
ilpo.jarvinen@linux.intel.com
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH] tty: serial: ma35d1_serial: Add missing check for ioremap
Date: Fri, 15 Sep 2023 17:49:00 +0800 [thread overview]
Message-ID: <d4e74e31-246c-1f8c-1465-b0bb6ce8454c@gmail.com> (raw)
In-Reply-To: <20230915071106.3347-1-nichen@iscas.ac.cn>
On 2023/9/15 下午 03:11, Chen Ni wrote:
> CAUTION - External Email: Do not click links or open attachments unless you acknowledge the sender and content.
>
>
> Add check for ioremap() and return the error if it fails in order to
> guarantee the success of ioremap().
>
> Fixes: 930cbf92db01 ("tty: serial: Add Nuvoton ma35d1 serial driver support")
> Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
> ---
> drivers/tty/serial/ma35d1_serial.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/tty/serial/ma35d1_serial.c b/drivers/tty/serial/ma35d1_serial.c
> index 465b1def9e11..4a9d1252de35 100644
> --- a/drivers/tty/serial/ma35d1_serial.c
> +++ b/drivers/tty/serial/ma35d1_serial.c
> @@ -695,6 +695,9 @@ static int ma35d1serial_probe(struct platform_device *pdev)
>
> up->port.iobase = res_mem->start;
> up->port.membase = ioremap(up->port.iobase, MA35_UART_REG_SIZE);
> + if (!up->port.membase)
> + return -ENOMEM;
> +
> up->port.ops = &ma35d1serial_ops;
>
> spin_lock_init(&up->port.lock);
> --
> 2.25.1
>
Thank you for this update.
Acked-by: Jacky Huang <ychuang3@nuvoton.com>
Best Regards,
Jacky
next prev parent reply other threads:[~2023-09-15 9:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-15 7:11 Chen Ni
2023-09-15 9:49 ` Jacky Huang [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-09-04 3:40 Chen Ni
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=d4e74e31-246c-1f8c-1465-b0bb6ce8454c@gmail.com \
--to=ychuang570808@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jirislaby@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=nichen@iscas.ac.cn \
--cc=schung@nuvoton.com \
--cc=ychuang3@nuvoton.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
all inboxes | Powered by JetHome®