Skip to content
Commit bcb4a75b authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by Jiri Kosina
Browse files

HID: hidraw: improve error handling in hidraw_init()



Several improvements in error handling:
- do not report success if alloc_chrdev_region() failed
- check for error code of cdev_add()
- use unregister_chrdev_region() instead of unregister_chrdev()
  if class_create() failed

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 2843b673
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment