mmc: omap_hsmmc: fix return value check of mmc_add_host()
In the Linux kernel, the following vulnerability has been resolved: mmc: omap_hsmmc: fix return value check of mmc_add_host() mmc_add_host() may return error, if we ignore its return value, it will lead two issues: 1. The memory that allocated in mmc_alloc_host() is leaked. 2. In the remove() path, mmc_remove_host() will be called to delete device, but it's not added yet, it will lead a kernel crash because of null-ptr-deref in device_del(). Fix this by checking the return value and goto error path wihch will call mmc_free_host().
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 5.10.163, 5.15.86, 5.4.229, 6.0.16, 6.1.2
- CVEs
- CVE-2022-50670
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 4 Nov 2026, 23:03 UTC · Revision 1
Source evidence
mmc: omap_hsmmc: fix return value check of mmc_add_host()
core-osv · Original sourcePublished 9 Dec 2025, 01:29 UTC
In the Linux kernel, the following vulnerability has been resolved: mmc: omap_hsmmc: fix return value check of mmc_add_host() mmc_add_host() may return error, if we ignore its return value, it will lead two issues: 1. The memory that allocated in mmc_alloc_host() is leaked. 2. In the remove() path, mmc_remove_host() will be called to delete device, but it's not added yet, it will lead a kernel crash because of null-ptr-deref in device_del(). Fix this by checking the return value and goto error path wihch will call mmc_free_host().
osv:CVE-2022-50670
Kernel
Fixed versions: 5.4.229, 5.10.163, 5.15.86, 6.0.16, 6.1.2
Complete source record
{
"id": "4def6c38470acfcb5949f44f7aba78e48bc9b5a68f062c24587836d1c67b3dc0",
"url": "https://osv.dev/vulnerability/CVE-2022-50670",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "mmc: omap_hsmmc: fix return value check of mmc_add_host()",
"summary": "In the Linux kernel, the following vulnerability has been resolved: mmc: omap_hsmmc: fix return value check of mmc_add_host() mmc_add_host() may return error, if we ignore its return value, it will lead two issues: 1. The memory that allocated in mmc_alloc_host() is leaked. 2. In the remove() path, mmc_remove_host() will be called to delete device, but it's not added yet, it will lead a kernel crash because of null-ptr-deref in device_del(). Fix this by checking the return value and goto error path wihch will call mmc_free_host().",
"evidence": "osv:CVE-2022-50670",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "5.4.229",
"evidence": "/affected/1/ranges"
},
{
"value": "5.10.163",
"evidence": "/affected/1/ranges"
},
{
"value": "5.15.86",
"evidence": "/affected/1/ranges"
},
{
"value": "6.0.16",
"evidence": "/affected/1/ranges"
},
{
"value": "6.1.2",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "unknown",
"structured": {
"id": "CVE-2022-50670",
"aliases": [
"CVE-2022-50670"
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "a45c6cb816474cefe56059fce422a9bdcd77e0dc"
},
{
"fixed": "f153c9e15f8961bdf38707853e15b42ea7c691d9"
},
{
"fixed": "fb3d596267a98813a7a8206097d8d46c98505a0d"
},
{
"fixed": "62005dfcc396424db3337a1dc3ab49623537f5e5"
},
{
"fixed": "a5f8a4583280a76e50329b910e91ef1dea1e6c79"
},
{
"fixed": "4e1dc24bcfc8257f24c0663badec7e4f3ae80558"
},
{
"fixed": "a525cad241c339ca00bf7ebf03c5180f2a9b767c"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50670.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "2.6.29"
},
{
"fixed": "5.4.229"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.5.0"
},
{
"fixed": "5.10.163"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.11.0"
},
{
"fixed": "5.15.86"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.16.0"
},
{
"fixed": "6.0.16"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.1.0"
},
{
"fixed": "6.1.2"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50670.json"
}
}
],
"modified": "2026-10-28T02:30:40.190808837Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/4e1dc24bcfc8257f24c0663badec7e4f3ae80558",
"https://git.kernel.org/stable/c/62005dfcc396424db3337a1dc3ab49623537f5e5",
"https://git.kernel.org/stable/c/a525cad241c339ca00bf7ebf03c5180f2a9b767c",
"https://git.kernel.org/stable/c/a5f8a4583280a76e50329b910e91ef1dea1e6c79",
"https://git.kernel.org/stable/c/f153c9e15f8961bdf38707853e15b42ea7c691d9",
"https://git.kernel.org/stable/c/fb3d596267a98813a7a8206097d8d46c98505a0d",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50670.json",
"https://nvd.nist.gov/vuln/detail/CVE-2022-50670",
"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-50670.json"
}
},
"related_cves": [
{
"value": "CVE-2022-50670",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": null
},
"source_id": "core-osv",
"document_id": 507802,
"published_at": "2025-12-09T01:29:21.864+00:00"
}