From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: lumingyindetect@126.com
Cc: LKML <linux-kernel@vger.kernel.org>,
linux-serial <linux-serial@vger.kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>,
LuMingYin <11570291+yin-luming@user.noreply.gitee.com>
Subject: Re: [PATCH] "drivers:Fixed memory leak in /linux/drivers/tty/serial/8250/8250_lpss.c file.
Date: Fri, 26 Apr 2024 12:06:45 +0300 (EEST) [thread overview]
Message-ID: <1ed76406-443d-63e2-3b3b-f6528a13f95a@linux.intel.com> (raw)
In-Reply-To: <20240426021939.1083521-1-lumingyindetect@126.com>
On Fri, 26 Apr 2024, lumingyindetect@126.com wrote:
> From: LuMingYin <11570291+yin-luming@user.noreply.gitee.com>
Use:
git log --oneline -- drivers/tty/serial/8250/8250_lpss.c
to learn what prefix you should use for shortlog (on the subject line).
Beyond the correct prefix, don't use filename in the shortlog at all.
"Fixed" -> "Fix"
"in xx file" is awfully generic, please be more specific where the leak
is.
> In the lpss8250_probe function in the file /linux/drivers/tty/serial/8250/8250_lpss.c, there were certain return paths where pci_free_irq_vectors was not called to release memory related to pdev, leading to a memory leak. This commit fixes that issue."
- Wrap this properly.
- Don't write full paths like that.
- Put () into description when talking about functions.
- Use imperative language, don't use "This patch ...".
- Add Fixes tag
> Signed-off-by: LuMingYin <11570291+yin-luming@user.noreply.gitee.com>
> ---
> drivers/tty/serial/8250/8250_lpss.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serial/8250/8250_lpss.c b/drivers/tty/serial/8250/8250_lpss.c
> index 776ec1ef29d6..2bb86f9cad5b 100644
> --- a/drivers/tty/serial/8250/8250_lpss.c
> +++ b/drivers/tty/serial/8250/8250_lpss.c
> @@ -344,11 +344,11 @@ static int lpss8250_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> uart.port.mapbase = pci_resource_start(pdev, 0);
> uart.port.membase = pcim_iomap(pdev, 0, 0);
> if (!uart.port.membase)
> - return -ENOMEM;
> + goto early_err_exit;
>
> ret = lpss->board->setup(lpss, &uart.port);
> if (ret)
> - return ret;
> + goto early_err_exit;
>
> dw8250_setup_port(&uart.port);
>
> @@ -367,6 +367,7 @@ static int lpss8250_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>
> err_exit:
> lpss->board->exit(lpss);
> +early_err_exit:
This label could be more specific that it's about freeing the vectors.
> pci_free_irq_vectors(pdev);
> return ret;
> }
>
--
i.
next prev parent reply other threads:[~2024-04-26 9:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-26 2:19 [PATCH] "drivers:Fixed memory leak in /linux/drivers/tty/serial/8250/8250_lpss.c file lumingyindetect
2024-04-26 9:06 ` Ilpo Järvinen [this message]
2024-04-26 14:34 ` Andy Shevchenko
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=1ed76406-443d-63e2-3b3b-f6528a13f95a@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=11570291+yin-luming@user.noreply.gitee.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=lumingyindetect@126.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