In the Linux kernel, the following vulnerability has been resolved: pps: fix warning in ppsregistercdev when register device fail Similar to previous commit 2a934fdb01db ("media: v4l2-dev: fix error handling in _videoregisterdevice()"), the release hook should be set before deviceregister(). Otherwise, when deviceregister() return error and putdevice() try to callback the release function, the below warning may happen. ------------[ cut here ]------------ WARNING: CPU: 1 PID: 4760 at drivers/base/core.c:2567 devicerelease+0x1bd/0x240 drivers/base/core.c:2567 Modules linked in: CPU: 1 UID: 0 PID: 4760 Comm: syz.4.914 Not tainted 6.17.0-rc3+ #1 NONE RIP: 0010:devicerelease+0x1bd/0x240 drivers/base/core.c:2567 Call Trace: <TASK> kobjectcleanup+0x136/0x410 lib/kobject.c:689 kobjectrelease lib/kobject.c:720 [inline] krefput include/linux/kref.h:65 [inline] kobjectput+0xe9/0x130 lib/kobject.c:737 putdevice+0x24/0x30 drivers/base/core.c:3797 ppsregistercdev+0x2da/0x370 drivers/pps/pps.c:402 ppsregistersource+0x2f6/0x480 drivers/pps/kapi.c:108 ppsttyopen+0x190/0x310 drivers/pps/clients/pps-ldisc.c:57 ttyldiscopen+0xa7/0x120 drivers/tty/ttyldisc.c:432 ttysetldisc+0x333/0x780 drivers/tty/ttyldisc.c:563 tiocsetd drivers/tty/ttyio.c:2429 [inline] ttyioctl+0x5d1/0x1700 drivers/tty/ttyio.c:2728 vfsioctl fs/ioctl.c:51 [inline] _dosysioctl fs/ioctl.c:598 [inline] _sesysioctl fs/ioctl.c:584 [inline] _x64sysioctl+0x194/0x210 fs/ioctl.c:584 dosyscallx64 arch/x86/entry/syscall64.c:63 [inline] dosyscall64+0x5f/0x2a0 arch/x86/entry/syscall64.c:94 entrySYSCALL64afterhwframe+0x76/0x7e </TASK> Before commit c79a39dc8d06 ("pps: Fix a use-after-free"), ppsregistercdev() call devicecreate() to create pps->dev, which will init dev->release to devicecreaterelease(). Now the comment is outdated, just remove it. Thanks for the reminder from Calvin Owens, 'kfreepps' should be removed in ppsregistersource() to avoid a double free in the failure case.