From: Greg KH <gregkh@linuxfoundation.org>
To: Xiu Jianfeng <xiujianfeng@huawei.com>
Cc: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com,
jirislaby@kernel.org, ben-linux@fluff.org,
linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org,
linux-kernel@vger.kernel.or
Subject: Re: [PATCH] tty: serial: samsung_tty: Fix clk resource leak issue
Date: Mon, 7 Nov 2022 08:17:13 +0100 [thread overview]
Message-ID: <Y2iw+QdyfGGNz9pU@kroah.com> (raw)
In-Reply-To: <20221107062120.20321-1-xiujianfeng@huawei.com>
On Mon, Nov 07, 2022 at 02:21:20PM +0800, Xiu Jianfeng wrote:
> In the s3c24xx_serial_get_options(), calling clk_get() without clk_put()
> will cause clk resource leak issue, this patch fixes it.
>
> Fixes: b497549a035c ("[ARM] S3C24XX: Split serial driver into core and per-cpu drivers")
> Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
> ---
> drivers/tty/serial/samsung_tty.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
> index 77d1363029f5..8a3bb9832172 100644
> --- a/drivers/tty/serial/samsung_tty.c
> +++ b/drivers/tty/serial/samsung_tty.c
> @@ -2529,9 +2529,10 @@ s3c24xx_serial_get_options(struct uart_port *port, int *baud,
> sprintf(clk_name, "clk_uart_baud%d", clk_sel);
>
> clk = clk_get(port->dev, clk_name);
> - if (!IS_ERR(clk))
> + if (!IS_ERR(clk)) {
> rate = clk_get_rate(clk);
> - else
> + clk_put(clk);
> + } else
How was this tested?
thanks,
greg k-h
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-11-07 7:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-07 6:21 [PATCH] tty: serial: samsung_tty: Fix clk resource leak issue Xiu Jianfeng
2022-11-07 7:17 ` Greg KH [this message]
2022-11-07 8:56 ` Krzysztof Kozlowski
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=Y2iw+QdyfGGNz9pU@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=alim.akhtar@samsung.com \
--cc=ben-linux@fluff.org \
--cc=jirislaby@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.or \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=xiujianfeng@huawei.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;
as well as URLs for NNTP newsgroup(s).