CVE-2022-49312

staging: rtl8712: fix a potential memory leak in r871xu_drv_init()

Medium · published February 26, 2025

CVSS v3.1
5.5
EPSS
0%
Percentile
18.0
In the wild
Unconfirmed
What it is

In the Linux kernel, the following vulnerability has been resolved:

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().

The record
Technical detail
CVSS v3.1
5.5 · MEDIUM
Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
CVSS v4.0
Not supplied
EPSS
0.00268 · 18.0th percentile
Published
2025-02-26T02:10Z
EPSS history
Timeline
  • 26 FEB 02:10Z
    staging: rtl8712: fix a potential memory leak in r871xu_drv_init()
    cvelistv5