power: supply: cpcap-battery: Fix missing nvmem_device_put() causing reference leak
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ fd46821e85de90fb5b7356251164af4815b6e3f6 · < a2c14ff63e0e02e3c832385e523e9cc81301171c| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
power: supply: cpcap-battery: Fix missing nvmem_device_put() causing reference leak
In cpcap_battery_detect_battery_type(), the reference to an nvmem device obtained via nvmem_device_find() is not released with nvmem_device_put() on the success or read-failure paths, causing a permanent reference leak. The driver’s retry logic on subsequent battery property reads can compound this leak, preventing the nvmem device from ever being freed.
Found by code review.
From the CVE record · Linux
The Linux kernel’s cpcap-battery driver fails to release an nvmem device reference after battery-type detection succeeds or a read fails. Repeated battery property reads can compound the leak and prevent the nvmem device from being freed. The input does not describe an attacker, access requirements, or user interaction.
Engineers running the Linux kernel with the cpcap-battery driver should check their installations; affected versions are not specified.