mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-15 21:30:43 +00:00
i2c-dev: Return correct error code on class_create() failure
We need to convert the error pointer from class_create(), else we'll return the successful return code from register_chrdev() on failure. Signed-off-by: Sven Wegener <sven.wegener@stealer.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
This commit is contained in:
parent
4ebb52d34f
commit
e74783ec3c
@ -583,8 +583,10 @@ static int __init i2c_dev_init(void)
|
||||
goto out;
|
||||
|
||||
i2c_dev_class = class_create(THIS_MODULE, "i2c-dev");
|
||||
if (IS_ERR(i2c_dev_class))
|
||||
if (IS_ERR(i2c_dev_class)) {
|
||||
res = PTR_ERR(i2c_dev_class);
|
||||
goto out_unreg_chrdev;
|
||||
}
|
||||
|
||||
res = i2c_add_driver(&i2cdev_driver);
|
||||
if (res)
|
||||
|
Loading…
Reference in New Issue
Block a user