From: Dan Carpenter <dan.carpenter@oracle.com>
To: xkernel.wang@foxmail.com
Cc: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] staging: rtl8723bs: fix potential memory leak in _rtw_init_xmit_priv()
Date: Tue, 27 Sep 2022 10:59:30 +0300 [thread overview]
Message-ID: <YzKtYksCuy+xrum4@kadam> (raw)
In-Reply-To: <tencent_F8100CE69CDC080E218AEF7033A5CCFF2507@qq.com>
On Mon, Sep 26, 2022 at 03:54:57PM +0800, xkernel.wang@foxmail.com wrote:
> From: Xiaoke Wang <xkernel.wang@foxmail.com>
>
> In _rtw_init_xmit_priv(), there are seven error paths for allocation
> failures without releasing the resources but directly goto `exit`, while
> the exit section only executes `return res;`, which can lead to various
> memory leaks.
>
> To properly release them, this patch unifies the error handlers of
> _rtw_init_xmit_priv() and several error handling paths are added.
> According to the allocation sequence, each error will jump to its
> corresponding error handling tag.
>
> As there is no proper device to test with, no runtime testing was
> performed.
>
> Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
This seems to introduce a similar use after free as mentioned in the
change to the other rtl driver.
list_add() followed by a free.
regards,
dan carpenter
prev parent reply other threads:[~2022-09-27 7:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-26 7:54 [PATCH v3] staging: rtl8723bs: fix potential memory leak in _rtw_init_xmit_priv() xkernel.wang
2022-09-27 7:59 ` Dan Carpenter [this message]
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=YzKtYksCuy+xrum4@kadam \
--to=dan.carpenter@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=xkernel.wang@foxmail.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