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