# CVE-2022-50827: scsi: lpfc: Fix memory leak in lpfc_create_port()

- Severity: not scored yet
- 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.25%, higher than 17% of CVEs (2026-12-01)
- Published: 2025-12-30T12:08:39.669Z
- Modified: 2026-06-17T05:24:15.417Z
- Assigned by: Linux

## Description

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

scsi: lpfc: Fix memory leak in lpfc_create_port()

Commit 5e633302ace1 ("scsi: lpfc: vmid: Add support for VMID in mailbox
command") introduced allocations for the VMID resources in
lpfc_create_port() after the call to scsi_host_alloc(). Upon failure on the
VMID allocations, the new code would branch to the 'out' label, which
returns NULL without unwinding anything, thus skipping the call to
scsi_host_put().

Fix the problem by creating a separate label 'out_free_vmid' to unwind the
VMID resources and make the 'out_put_shost' label call only
scsi_host_put(), as was done before the introduction of allocations for
VMID.

(As written by CVE List.)

## Affected

- Linux Linux: from 5e633302ace1f61f8ea5a3ce21e19a4d79126cca before 9749595feb33a1a2b848800192224ffeed5346b4; from 5e633302ace1f61f8ea5a3ce21e19a4d79126cca before 5ea1f195f51c2bb5915ccfb2b2885ca81ce9262b; from 5e633302ace1f61f8ea5a3ce21e19a4d79126cca before dc8e483f684a24cc06e1d5fa958b54db58855093; 5.14 (not affected: before 5.14; from 5.15.76 up to 5.15.*; from 6.0.6 up to 6.0.*; from 6.1 up to *)

## References

- <https://git.kernel.org/stable/c/9749595feb33a1a2b848800192224ffeed5346b4>
- <https://git.kernel.org/stable/c/5ea1f195f51c2bb5915ccfb2b2885ca81ce9262b>
- <https://git.kernel.org/stable/c/dc8e483f684a24cc06e1d5fa958b54db58855093>

## Sources

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

---

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