Commit a5bde3a1 authored by Anton Protopopov's avatar Anton Protopopov Committed by Greg Kroah-Hartman

Staging: comedi: check the return value of kobject_set_name

Added a check of the return value of the kobject_set_name function.
Signed-off-by: default avatarAnton Protopopov <a.s.protopopov@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent eedd8d7e
......@@ -2587,7 +2587,14 @@ static int __init comedi_init(void)
return -EIO;
cdev_init(&comedi_cdev, &comedi_fops);
comedi_cdev.owner = THIS_MODULE;
kobject_set_name(&comedi_cdev.kobj, "comedi");
retval = kobject_set_name(&comedi_cdev.kobj, "comedi");
if (retval) {
unregister_chrdev_region(MKDEV(COMEDI_MAJOR, 0),
COMEDI_NUM_MINORS);
return retval;
}
if (cdev_add(&comedi_cdev, MKDEV(COMEDI_MAJOR, 0), COMEDI_NUM_MINORS)) {
unregister_chrdev_region(MKDEV(COMEDI_MAJOR, 0),
COMEDI_NUM_MINORS);
......
Markdown is supported
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