mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 12:44:11 +08:00
HID: roccat: silence an uninitialized variable warning
My static checker complains because we use "dev_id" before we check for errors so it could be uninitialized. Fix this by moving the error handling forward a couple lines. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
d66435cc7d
commit
85d08340c3
@ -421,14 +421,13 @@ static int __init roccat_init(void)
|
||||
|
||||
retval = alloc_chrdev_region(&dev_id, ROCCAT_FIRST_MINOR,
|
||||
ROCCAT_MAX_DEVICES, "roccat");
|
||||
|
||||
roccat_major = MAJOR(dev_id);
|
||||
|
||||
if (retval < 0) {
|
||||
pr_warn("can't get major number\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
roccat_major = MAJOR(dev_id);
|
||||
|
||||
cdev_init(&roccat_cdev, &roccat_ops);
|
||||
retval = cdev_add(&roccat_cdev, dev_id, ROCCAT_MAX_DEVICES);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user