In the Linux kernel, the following vulnerability has been resolved: ubi: Fix possible null-ptr-deref in ubifreevolume() It willl cause null-ptr-deref in the following case: uifinit() ubiaddvolume() cdevadd() -> if it fails, call killvolumes() deviceregister() killvolumes() -> if ubiaddvolume() fails call this function ubifreevolume() cdevdel() deviceunregister() -> trying to delete a not added device, it causes null-ptr-deref So in ubifreevolume(), it delete devices whether they are added or not, it will causes null-ptr-deref. Handle the error case whlie calling ubiaddvolume() to fix this problem. If add volume fails, set the corresponding vol to null, so it can not be accessed in killvolumes() and release the resource in ubiaddvolume() error path.