[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YkxO7HPTsF4CvPe6@kroah.com>
Date: Tue, 5 Apr 2022 16:15:08 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: xkernel.wang@...mail.com
Cc: Larry.Finger@...inger.net, florian.c.schilhabel@...glemail.com,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: rtl8712: fix a potential memory leak in
r871xu_drv_init()
On Tue, Apr 05, 2022 at 12:43:07PM +0800, xkernel.wang@...mail.com wrote:
> From: Xiaoke Wang <xkernel.wang@...mail.com>
>
> In r871xu_drv_init(), if r8712_init_drv_sw() fails, then the memory
> allocated by r8712_alloc_io_queue() in r8712_usb_dvobj_init() is not
> properly released as there is no action will be performed by
> r8712_usb_dvobj_deinit().
> To properly release it, we should call r8712_free_io_queue() in
> r8712_usb_dvobj_deinit().
>
> Besides, in r871xu_dev_remove(), r8712_usb_dvobj_deinit() will be called
> by r871x_dev_unload() under condition `padapter->bup` and
> r8712_free_io_queue() is called by r8712_free_drv_sw().
> However, r8712_usb_dvobj_deinit() does not rely on `padapter->bup` and
> calling r8712_free_io_queue() in r8712_free_drv_sw() is negative for
> better understading the code.
> So I move r8712_usb_dvobj_deinit() into r871xu_dev_remove(), and remove
> r8712_free_io_queue() from r8712_free_drv_sw().
>
> Signed-off-by: Xiaoke Wang <xkernel.wang@...mail.com>
> ---
> drivers/staging/rtl8712/os_intfs.c | 1 -
> drivers/staging/rtl8712/usb_intf.c | 6 +++---
> 2 files changed, 3 insertions(+), 4 deletions(-)
I've applied this patch, but dropped all of your other pending ones.
Please fix up the remaining ones like this and resend.
thanks,
greg k-h
Powered by blists - more mailing lists