[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6f5ca23d-4f23-4030-2196-35026e936145@linux.alibaba.com>
Date: Mon, 10 Jul 2023 18:03:12 +0800
From: Baolin Wang <baolin.wang@...ux.alibaba.com>
To: Chunyan Zhang <chunyan.zhang@...soc.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>
Cc: linux-serial@...r.kernel.org, Orson Zhai <orsonzhai@...il.com>,
Chunyan Zhang <zhang.lyra@...il.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] serial: sprd: Fix DMA buffer leak issue
On 7/10/2023 4:03 PM, Chunyan Zhang wrote:
> Release DMA buffer when _probe() returns fail to avoid memory leak.
>
> Fixes: f4487db58eb7 ("serial: sprd: Add DMA mode support")
> Signed-off-by: Chunyan Zhang <chunyan.zhang@...soc.com>
LGTM.
Reviewed-by: Baolin Wang <baolin.wang@...ux.alibaba.com>
> ---
> drivers/tty/serial/sprd_serial.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
> index 942808517393..e1f11382fc39 100644
> --- a/drivers/tty/serial/sprd_serial.c
> +++ b/drivers/tty/serial/sprd_serial.c
> @@ -1203,7 +1203,7 @@ static int sprd_probe(struct platform_device *pdev)
> ret = uart_register_driver(&sprd_uart_driver);
> if (ret < 0) {
> pr_err("Failed to register SPRD-UART driver\n");
> - return ret;
> + goto free_rx_buf;
> }
> }
> sprd_ports_num++;
> @@ -1222,6 +1222,8 @@ static int sprd_probe(struct platform_device *pdev)
> sprd_port[index] = NULL;
> sprd_ports_num--;
> uart_unregister_driver(&sprd_uart_driver); > +free_rx_buf:
> + sprd_rx_free_buf(sport);
> return ret;
> }
>
Powered by blists - more mailing lists