From: Ondrej Zary <linux@zary.sk>
To: Sergey Shtylyov <s.shtylyov@omp.ru>
Cc: Sergei Shtylyov <sergei.shtylyov@gmail.com>,
Damien Le Moal <damien.lemoal@opensource.wdc.com>,
Dan Carpenter <error27@gmail.com>, Christoph Hellwig <hch@lst.de>,
linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pata_parport: fix possible memory leak
Date: Sat, 11 Mar 2023 22:11:57 +0100 [thread overview]
Message-ID: <202303112211.57761.linux@zary.sk> (raw)
In-Reply-To: <2223c1dc-1869-a307-e5da-772cb27b34e5@omp.ru>
On Saturday 11 March 2023 21:23:25 Sergey Shtylyov wrote:
> On 3/11/23 11:19 PM, Sergei Shtylyov wrote:
>
> >> When ida_alloc() fails, "pi" is not freed although the misleading
> >> comment says otherwise.
> >> Move the ida_alloc() call up so we really don't have to free it.
>
> Wait, but don't we still need to call kfree() in pi_init_one()?
If it fails at device_register, the dev.release is already set to pata_parport_dev_release which does the kfree(). put_device() should call it. If it fails later, device_unregister() should do it.
> >> Reported-by: kernel test robot <lkp@intel.com>
> >> Reported-by: Dan Carpenter <error27@gmail.com>
> >> Link: https://lore.kernel.org/r/202303111822.IHNchbkp-lkp@intel.com/
> >> Signed-off-by: Ondrej Zary <linux@zary.sk>
> >
> > Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
> >
> > [...]
>
> MBR, Sergey
>
--
Ondrej Zary
next prev parent reply other threads:[~2023-03-11 21:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3ab89ddc-cb60-47c4-86ad-cdad94a8a3d7@kili.mountain>
2023-03-11 18:51 ` [PATCH] pata_parport: fix possible memory leak Ondrej Zary
2023-03-11 20:19 ` Sergei Shtylyov
2023-03-11 20:23 ` Sergey Shtylyov
2023-03-11 21:11 ` Ondrej Zary [this message]
2023-03-11 21:39 ` Ondrej Zary
2023-03-11 21:44 ` [PATCH v2] " Ondrej Zary
2023-03-12 0:56 ` Damien Le Moal
2023-03-12 21:24 ` Ondrej Zary
2023-03-12 23:17 ` Damien Le Moal
2023-03-13 7:53 ` Ondrej Zary
2023-03-14 22:58 ` [PATCH v3] pata_parport: fix memory leaks Ondrej Zary
2023-03-16 7:53 ` Damien Le Moal
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=202303112211.57761.linux@zary.sk \
--to=linux@zary.sk \
--cc=damien.lemoal@opensource.wdc.com \
--cc=error27@gmail.com \
--cc=hch@lst.de \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=s.shtylyov@omp.ru \
--cc=sergei.shtylyov@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;
as well as URLs for NNTP newsgroup(s).