scsi: lpfc: Fix memory leak in lpfc_create_port()
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.
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 5.15.76, 6.0.6
- CVEs
- CVE-2022-50827
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 7 Nov 2026, 03:06 UTC · Revision 1
Source evidence
scsi: lpfc: Fix memory leak in lpfc_create_port()
core-osv · Original sourcePublished 30 Dec 2025, 12:08 UTC
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.
osv:CVE-2022-50827
Kernel
Fixed versions: 5.15.76, 6.0.6
Complete source record
{
"id": "ffd525c69d0ca947782d614102b0800c42ed683bacaa97ff2ba93733d08dd410",
"url": "https://osv.dev/vulnerability/CVE-2022-50827",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "scsi: lpfc: Fix memory leak in lpfc_create_port()",
"summary": "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.",
"evidence": "osv:CVE-2022-50827",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "5.15.76",
"evidence": "/affected/1/ranges"
},
{
"value": "6.0.6",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "unknown",
"structured": {
"id": "CVE-2022-50827",
"aliases": [
"CVE-2022-50827"
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "5e633302ace1f61f8ea5a3ce21e19a4d79126cca"
},
{
"fixed": "9749595feb33a1a2b848800192224ffeed5346b4"
},
{
"fixed": "5ea1f195f51c2bb5915ccfb2b2885ca81ce9262b"
},
{
"fixed": "dc8e483f684a24cc06e1d5fa958b54db58855093"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50827.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.14.0"
},
{
"fixed": "5.15.76"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.16.0"
},
{
"fixed": "6.0.6"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50827.json"
}
}
],
"modified": "2026-10-28T02:30:49.175053803Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/5ea1f195f51c2bb5915ccfb2b2885ca81ce9262b",
"https://git.kernel.org/stable/c/9749595feb33a1a2b848800192224ffeed5346b4",
"https://git.kernel.org/stable/c/dc8e483f684a24cc06e1d5fa958b54db58855093",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50827.json",
"https://nvd.nist.gov/vuln/detail/CVE-2022-50827",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50827.json"
}
},
"related_cves": [
{
"value": "CVE-2022-50827",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": null
},
"source_id": "core-osv",
"document_id": 517618,
"published_at": "2025-12-30T12:08:39.669+00:00"
}