From: Jean Delvare <khali@linux-fr.org>
To: Sven Wegener <sven.wegener@stealer.net>
Cc: i2c@lm-sensors.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i2c-dev: Return correct error code on class_create() failure
Date: Thu, 11 Sep 2008 13:04:42 +0200 [thread overview]
Message-ID: <20080911130442.6ebd10c6@hyperion.delvare> (raw)
In-Reply-To: <alpine.LNX.2.00.0809102128110.19109@titan.stealer.net>
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 <sven.wegener@stealer.net>
> ---
> 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
prev parent reply other threads:[~2008-09-11 11:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-10 19:30 [PATCH] i2c-dev: Return correct error code on class_create() failure Sven Wegener
2008-09-11 11:04 ` Jean Delvare [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080911130442.6ebd10c6@hyperion.delvare \
--to=khali@linux-fr.org \
--cc=i2c@lm-sensors.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sven.wegener@stealer.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox