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