Hi Sven,

On Wed, 10 Sep 2008 21:30:27 +0200 (CEST), Sven Wegener wrote:
> 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 <[EMAIL PROTECTED]>
> ---
>  drivers/i2c/i2c-dev.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
> index af4491f..307d976 100644
> --- a/drivers/i2c/i2c-dev.c
> +++ b/drivers/i2c/i2c-dev.c
> @@ -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)

Good catch. Patch applied, thanks.

-- 
Jean Delvare

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

Reply via email to