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 v6.0.16 by commit b5de1eac71fec1af7723f1083d23a24789fd795c, it was introduced in version v4.12 by commit 233ed09d7fdacf592ee91e6c97ce5f4364fbe7c0. For more details please see the references link.