In the Linux kernel, the following vulnerability has been resolved: mailbox: zynq-ipi: fix error handling while deviceregister() fails If deviceregister() fails, it has two issues: 1. The name allocated by devsetname() is leaked. 2. The parent of device is not NULL, deviceunregister() is called in zynqmpipifreemboxes(), it will lead a kernel crash because of removing not added device. Call putdevice() to give up the reference, so the name is freed in kobjectcleanup(). Add device registered check in zynqmpipifree_mboxes() to avoid null-ptr-deref.