chardev: fix error handling in cdevdeviceadd()
This is an automated ID intended to aid in discovery of potential security vulnerabilities. The actual impact and attack plausibility have not yet been proven. This ID is fixed in Linux Kernel version v5.10.163 by commit c46db6088bccff5115674d583fef46ede80077a2, it was introduced in version v4.12 by commit 233ed09d7fdacf592ee91e6c97ce5f4364fbe7c0. For more details please see the references link.