In the Linux kernel, the following vulnerability has been resolved:
scsi: lpfc: Fix memory leak in lpfccreateport()
Commit 5e633302ace1 ("scsi: lpfc: vmid: Add support for VMID in mailbox command") introduced allocations for the VMID resources in lpfccreateport() after the call to scsihostalloc(). 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 scsihostput().
Fix the problem by creating a separate label 'outfreevmid' to unwind the VMID resources and make the 'outputshost' label call only scsihostput(), as was done before the introduction of allocations for VMID.
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50827.json",
"cna_assigner": "Linux"
}