Skip to content
Heist/ feed
Back to feed
UnratedFix available

macintosh: fix possible memory leak in macio_add_one_device()

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: macintosh: fix possible memory leak in macio_add_one_device() Afer commit 1fa5ae857bb1 ("driver core: get rid of struct device's bus_id string array"), the name of device is allocated dynamically. It needs to be freed when of_device_register() fails. Call put_device() to give up the reference that's taken in device_initialize(), so that it can be freed in kobject_cleanup() when the refcount hits 0. macio device is freed in macio_release_dev(), so the kfree() can be removed.

Products
Kernel
Affected versions
Not specified
Fixed versions
4.14.303, 4.19.270, 4.9.337, 5.10.163, 5.15.86, 5.4.229, 6.0.16, 6.1.2
CVEs
CVE-2022-50474
Confirmed fixed CVEs
Not specified
Updated in this feed
2 Nov 2026, 20:29 UTC · Revision 1

Source evidence

macintosh: fix possible memory leak in macio_add_one_device()

core-osv · Original source

Published 4 Oct 2025, 15:16 UTC

In the Linux kernel, the following vulnerability has been resolved: macintosh: fix possible memory leak in macio_add_one_device() Afer commit 1fa5ae857bb1 ("driver core: get rid of struct device's bus_id string array"), the name of device is allocated dynamically. It needs to be freed when of_device_register() fails. Call put_device() to give up the reference that's taken in device_initialize(), so that it can be freed in kobject_cleanup() when the refcount hits 0. macio device is freed in macio_release_dev(), so the kfree() can be removed.

osv:CVE-2022-50474

Kernel

Fixed versions: 4.9.337, 4.14.303, 4.19.270, 5.4.229, 5.10.163, 5.15.86, 6.0.16, 6.1.2

Complete source record
{
  "id": "cfc037ca8f2579e9f916440e9cb96b339b8285b6d6d933c9fd0ac29475122676",
  "url": "https://osv.dev/vulnerability/CVE-2022-50474",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "macintosh: fix possible memory leak in macio_add_one_device()",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: macintosh: fix possible memory leak in macio_add_one_device() Afer commit 1fa5ae857bb1 (\"driver core: get rid of struct device's bus_id string array\"), the name of device is allocated dynamically. It needs to be freed when of_device_register() fails. Call put_device() to give up the reference that's taken in device_initialize(), so that it can be freed in kobject_cleanup() when the refcount hits 0. macio device is freed in macio_release_dev(), so the kfree() can be removed.",
    "evidence": "osv:CVE-2022-50474",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "4.9.337",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "4.14.303",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "4.19.270",
            "evidence": "/affected/1/ranges"
          },
          {
            "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-50474",
      "aliases": [
        "CVE-2022-50474"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "1fa5ae857bb14f6046205171d98506d8112dd74e"
                },
                {
                  "fixed": "3a866ff6fc2232c8e393cdb55ffb8ce947349e03"
                },
                {
                  "fixed": "aa9054267366ff0a382d403d17728e21951ddbb9"
                },
                {
                  "fixed": "35858b87a943917fa30172aa4bf01ce7adbcb42c"
                },
                {
                  "fixed": "b29a2f1dd33ae9b94821ab2f4d398b9081786748"
                },
                {
                  "fixed": "2ac0a7059b7bcbed35bfffa34a82c9a9e99638ef"
                },
                {
                  "fixed": "19ded60b40e86b0903c8d5bd0161437ed5107a8b"
                },
                {
                  "fixed": "ca765257feb89dacf604ced9cd233db5f865dee0"
                },
                {
                  "fixed": "76837e7f6b30da72ad59f56291e22804a219e015"
                },
                {
                  "fixed": "5ca86eae55a2f006e6c1edd2029b2cacb6979515"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50474.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "2.6.30"
                },
                {
                  "fixed": "4.9.337"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "4.10.0"
                },
                {
                  "fixed": "4.14.303"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "4.15.0"
                },
                {
                  "fixed": "4.19.270"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "4.20.0"
                },
                {
                  "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-50474.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:23.529256518Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/19ded60b40e86b0903c8d5bd0161437ed5107a8b",
        "https://git.kernel.org/stable/c/2ac0a7059b7bcbed35bfffa34a82c9a9e99638ef",
        "https://git.kernel.org/stable/c/35858b87a943917fa30172aa4bf01ce7adbcb42c",
        "https://git.kernel.org/stable/c/3a866ff6fc2232c8e393cdb55ffb8ce947349e03",
        "https://git.kernel.org/stable/c/5ca86eae55a2f006e6c1edd2029b2cacb6979515",
        "https://git.kernel.org/stable/c/76837e7f6b30da72ad59f56291e22804a219e015",
        "https://git.kernel.org/stable/c/aa9054267366ff0a382d403d17728e21951ddbb9",
        "https://git.kernel.org/stable/c/b29a2f1dd33ae9b94821ab2f4d398b9081786748",
        "https://git.kernel.org/stable/c/ca765257feb89dacf604ced9cd233db5f865dee0",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50474.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-50474",
        "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-50474.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-50474",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 489850,
  "published_at": "2025-10-04T15:16:35.537+00:00"
}