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