In the Linux kernel, the following vulnerability has been resolved: misc: tifm: fix possible memory leak in tifm7xx1switchmedia() If deviceregister() returns error in tifm7xx1switchmedia(), name of kobject which is allocated in devsetname() called in deviceadd() is leaked. Never directly free @dev after calling deviceregister(), even if it returned an error! Always use putdevice() to give up the reference initialized.