From: Francois Romieu <romieu@fr.zoreil.com>
To: Li Zetao <lizetao1@huawei.com>
Cc: 3chas3@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] atm: idt77252: fix kmemleak when rmmod idt77252
Date: Sun, 19 Mar 2023 01:28:43 +0100 [thread overview]
Message-ID: <20230319002843.GA158280@electric-eye.fr.zoreil.com> (raw)
In-Reply-To: <20230317035228.2635209-1-lizetao1@huawei.com>
Li Zetao <lizetao1@huawei.com> :
> There are memory leaks reported by kmemleak:
[...]
> diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
> index eec0cc2144e0..060f32b0def3 100644
> --- a/drivers/atm/idt77252.c
> +++ b/drivers/atm/idt77252.c
[...]
> @@ -2952,6 +2953,16 @@ open_card_ubr0(struct idt77252_dev *card)
> return 0;
> }
>
> +static void
> +close_card_ubr0(struct idt77252_dev *card)
> +{
> + struct vc_map *vc;
> +
> + vc = card->vcs[0];
Nit:
+ struct vc_map *vc = card->vcs[0];
I have not found any opportunity for a double free related to the patch.
So, other than the nit above:
Reviewed-by: Francois Romieu <romieu@fr.zoreil.com>
FWIW
- the driver leaks on error in open_card_ubr0.
- some forward declarations (alloc_scq, free_scq, etc.) are useless.
- struct idt77252_dev.next is useless. It was probably cargo-culted from
some driver while hoping to enumerate devices (not that uncommon the
early 2000). PCI driver registeering could thus look more idiomatic.
- deinit_card can be called two times in an error path and trigger a BUG_ON
in atm_dev_deregister.
--
Ueimor
next prev parent reply other threads:[~2023-03-19 0:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-17 3:52 Li Zetao
2023-03-19 0:28 ` Francois Romieu [this message]
2023-03-20 14:33 ` [PATCH v2] " Li Zetao
2023-03-22 4:20 ` patchwork-bot+netdevbpf
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=20230319002843.GA158280@electric-eye.fr.zoreil.com \
--to=romieu@fr.zoreil.com \
--cc=3chas3@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizetao1@huawei.com \
--cc=netdev@vger.kernel.org \
/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®