Messages in this thread | | | Date | Tue, 27 Sep 2022 10:59:30 +0300 | From | Dan Carpenter <> | Subject | Re: [PATCH v3] staging: rtl8723bs: fix potential memory leak in _rtw_init_xmit_priv() |
| |
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
| |