The put_device() calls rmi_release_function() which frees "fn" so the dereference on the next line "fn->num_of_irqs" is a use after free. Move the put_device() to the end to fix this. Additional info: 社区有patch已经解决 Input: synaptics-rmi4 - fix use after free in rmi_unregister_function() commit 6c71e065befb2fae8f1461559b940c04e1071bd5 Reference:https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.10.y&id=6c71e065befb2fae8f1461559b940c04e1071bd5 git cherry-pick -s 6c71e065b(with stable-v5.10.201 repo added)
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/2451