[PATCH 5.4 01/78] chardev: Avoid potential use-after-free in chrdev_open()