提交 e74783ec 编写于 作者: S Sven Wegener 提交者: Jean Delvare

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: NSven Wegener <sven.wegener@stealer.net>
Signed-off-by: NJean Delvare <khali@linux-fr.org>
上级 4ebb52d3
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册