diff options
| author | Xiaoke Wang <[email protected]> | 2022-04-05 12:43:07 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2022-04-05 16:14:38 +0200 |
| commit | 7288ff561de650d4139fab80e9cb0da9b5b32434 (patch) | |
| tree | 0b7d399dc2c24e425308af3406b5978cc1b708f6 /tools/perf/scripts/python/netdev-times.py | |
| parent | a461466e60d2a009ce83ac7a25d931c1ec5e17ad (diff) | |
staging: rtl8712: fix a potential memory leak in r871xu_drv_init()
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().
Reviewed-by: Dan Carpenter <[email protected]>
Signed-off-by: Xiaoke Wang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/netdev-times.py')
0 files changed, 0 insertions, 0 deletions