Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e74783ec authored by Sven Wegener's avatar Sven Wegener Committed by Jean Delvare
Browse files

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: default avatarSven Wegener <sven.wegener@stealer.net>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
parent 4ebb52d3
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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)