# CVE-2022-49780: scsi: target: tcm_loop: Fix possible name leak in tcm_loop_setup_hba_bus()

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.22%, higher than 12% of CVEs (2026-12-01)
- Published: 2025-05-01T14:09:15.135Z
- Modified: 2026-11-05T20:17:10.647Z
- Weaknesses: CWE-401
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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

scsi: target: tcm_loop: Fix possible name leak in tcm_loop_setup_hba_bus()

If device_register() fails in tcm_loop_setup_hba_bus(), the name allocated
by dev_set_name() need be freed. As comment of device_register() says, it
should use put_device() to give up the reference in the error path. So fix
this by calling put_device(), then the name can be freed in kobject_cleanup().
The 'tl_hba' will be freed in tcm_loop_release_adapter(), so it don't need
goto error label in this case.

(As written by CVE List.)

## Affected

- Linux Linux: from 3703b2c5d041a68095cdd22380c23ce27d449ad7 before 41a6b8b527a5957fab41c3c05e25ad125268e2e9; from 3703b2c5d041a68095cdd22380c23ce27d449ad7 before 28f7ff5e7559d226e63c7c5de74eb075a83d8c53; from 3703b2c5d041a68095cdd22380c23ce27d449ad7 before 75205f1b47a88c3fac4f30bd7567e89b2887c7fd; from 3703b2c5d041a68095cdd22380c23ce27d449ad7 before a636772988bafab89278e7bb3420d8e8eacfe912; from 3703b2c5d041a68095cdd22380c23ce27d449ad7 before dce0589a3faec9e2e543e97bca7e62592ec85585; from 3703b2c5d041a68095cdd22380c23ce27d449ad7 before bc68e428d4963af0201e92159629ab96948f0893; 2.6.39 (not affected: before 2.6.39; from 4.19.267 up to 4.19.*; from 5.4.225 up to 5.4.*; from 5.10.156 up to 5.10.*; from 5.15.80 up to 5.15.*; from 6.0.10 up to 6.0.*; from 6.1 up to *)
- linux linux_kernel: from 2.6.39 before 4.19.267; from 4.20 before 5.4.225; from 5.5 before 5.10.156; from 5.11 before 5.15.80; from 5.16 before 6.0.10; 6.1

## References

- <https://git.kernel.org/stable/c/41a6b8b527a5957fab41c3c05e25ad125268e2e9> (patch)
- <https://git.kernel.org/stable/c/28f7ff5e7559d226e63c7c5de74eb075a83d8c53> (patch)
- <https://git.kernel.org/stable/c/75205f1b47a88c3fac4f30bd7567e89b2887c7fd> (patch)
- <https://git.kernel.org/stable/c/a636772988bafab89278e7bb3420d8e8eacfe912> (patch)
- <https://git.kernel.org/stable/c/dce0589a3faec9e2e543e97bca7e62592ec85585> (patch)
- <https://git.kernel.org/stable/c/bc68e428d4963af0201e92159629ab96948f0893> (patch)

## Sources

- CVE List: [CVE-2022-49780](https://www.cve.org/CVERecord?id=CVE-2022-49780), CVE Terms of Use, modified 2026-11-05
- NVD: [CVE-2022-49780](https://nvd.nist.gov/vuln/detail/CVE-2022-49780), Public domain, modified 2026-11-05

---

Page: https://cve.day/CVE-2022-49780 · Whole record: https://cve.day/CVE-2022-49780.json · Rebuilt by cve.day 2026-11-25T22:58:20.866Z
