CVE-2026-72240: mfd: sm501: Fix reference leak on failed device registration
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
mfd: sm501: Fix reference leak on failed device registration
When platform_device_register() fails in sm501_register_device(), the embedded struct device in pdev has already been initialized by device_initialize(), but the failure path only reports the error and returns without dropping the device reference for the current platform device:
sm501_register_device()
-> platform_device_register(pdev)
-> device_initialize(&pdev->dev)
-> setup_pdev_dma_masks(pdev)
-> platform_device_add(pdev)This leads to a reference leak when platform_device_register() fails. Fix this by calling platform_device_put() before returning the error.
The issue was identified by a static analysis tool I developed and confirmed by manual review.
The Linux kernel CVE team has assigned CVE-2026-72240 to this issue.
Affected and fixed versions
===========================
Issue introduced in 2.6.21 with commit b6d6454fdb66f3829af8b92ab06825b6060fdf7e and fixed in 5.10.261 with commit bbb1ecaed4ed7680e63d3a0f143f03de32de5d6e Issue introduced in 2.6.21 with commit b6d6454fdb66f3829af8b92ab06825b6060fdf7e and fixed in 5.15.212 with commit e2dac91380a10e9e8d5883fb73ce9d9b390a629c Issue introduced in 2.6.21 with commit b6d6454fdb66f3829af8b92ab06825b6060fdf7e and fixed in 6.1.178 with commit 0baf9d43a7b7b43df2900bd8656e75b725028b6e Issue introduced in 2.6.21 with commit b6d6454fdb66f3829af8b92ab06825b6060fdf7e and fixed in 6.6.145 with commit a3e340d506c1036a747fb0972aebf1063f7ef30e Issue introduced in 2.6.21 with commit b6d6454fdb66f3829af8b92ab06825b6060fdf7e and fixed in 6.12.97 with commit 760a1029692f1d788dc11aa636a3bf432e58b240 Issue introduced in 2.6.21 with commit b6d6454fdb66f3829af8b92ab06825b6060fdf7e and fixed in 6.18.40 with commit 16a42c88c4667fa0bd944e438a667e059551f1f1 Issue introduced in 2.6.21 with commit b6d6454fdb66f3829af8b92ab06825b6060fdf7e and fixed in 7.1.5 with commit 2ff8156fd500d54c61430b6834137fd0a07047ce Issue introduced in 2.6.21 with commit b6d6454fdb66f3829af8b92ab06825b6060fdf7e and fixed in 7.2-rc1 with commit 8c2f0b42fc252e1bf1c7746447091a468e784ca1
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-72240
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/mfd/sm501.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/bbb1ecaed4ed7680e63d3a0f143f03de32de5d6e https://git.kernel.org/stable/c/e2dac91380a10e9e8d5883fb73ce9d9b390a629c https://git.kernel.org/stable/c/0baf9d43a7b7b43df2900bd8656e75b725028b6e https://git.kernel.org/stable/c/a3e340d506c1036a747fb0972aebf1063f7ef30e https://git.kernel.org/stable/c/760a1029692f1d788dc11aa636a3bf432e58b240 https://git.kernel.org/stable/c/16a42c88c4667fa0bd944e438a667e059551f1f1 https://git.kernel.org/stable/c/2ff8156fd500d54c61430b6834137fd0a07047ce https://git.kernel.org/stable/c/8c2f0b42fc252e1bf1c7746447091a468e784ca1