From: Daniel Paschka <monkey20181@gmx.net>
To: linux-kernel@vger.kernel.org
Subject: Re: clean up and warnings patch for 2.6.12-rc4-mm1 i2c-chip
Date: Mon, 16 May 2005 11:39:40 +0200 [thread overview]
Message-ID: <42886A5C.6030908@gmx.net> (raw)
In-Reply-To: <44zCV-1kI-17@gated-at.bofh.it>
[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]
Alexey Fisher wrote:
> diff -uprN linux/drivers/i2c/chips/max1619.c linux-2.6-dev/drivers/i2c/chips/max1619.c
> --- linux/drivers/i2c/chips/max1619.c 2005-05-15 22:49:31.000000000 +0200
> +++ linux-2.6-dev/drivers/i2c/chips/max1619.c 2005-05-15 21:05:56.000000000 +0200
> @@ -195,6 +195,7 @@ static int max1619_detect(struct i2c_ada
> u8 reg_config=0, reg_convrate=0, reg_status=0;
> u8 man_id, chip_id;
> if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
> + err = -ENODEV;
> goto exit;
Sure about that, I think there are some brackets missing.
> if (!(data = kmalloc(sizeof(struct max1619_data), GFP_KERNEL))) {
> @@ -234,6 +235,7 @@ static int max1619_detect(struct i2c_ada
> dev_dbg(&adapter->dev,
> "MAX1619 detection failed at 0x%02x.\n",
> address);
> + return -ENODEV;
> goto exit_free;
> }
> }
I would expect gcc to throw a warning about unreachable code here
because goto exit_free ist behind a return statement.
Don't you mean
err = -ENODEV;
goto exit_free;
That way the data structure data will be freed, too.
> @@ -254,6 +256,7 @@ static int max1619_detect(struct i2c_ada
> dev_info(&adapter->dev,
> "Unsupported chip (man_id=0x%02X, "
> "chip_id=0x%02X).\n", man_id, chip_id);
> + return -ENODEV;
> goto exit_free;
> }
Same here.
I am not using this driver and am not fully up to date with the kernel
sources so I am sorry if I am talking nonesense here.
Bye Daniel
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
next parent reply other threads:[~2005-05-16 9:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <44zCV-1kI-17@gated-at.bofh.it>
2005-05-16 9:39 ` Daniel Paschka [this message]
2005-05-15 22:14 clean up and warnings patch for 2.6.12-rc4-mm1 i2c-chip Alexey Fisher
2005-05-16 17:19 ` Jean Delvare
2005-05-17 6:41 ` Alexey Fisher
2005-05-17 7:41 ` Jean Delvare
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=42886A5C.6030908@gmx.net \
--to=monkey20181@gmx.net \
--cc=linux-kernel@vger.kernel.org \
/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