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