From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org, sensors@stimpy.netroedge.com
Subject: Re: [PATCH] i2c driver changes for 2.5.72
Date: Wed, 18 Jun 2003 11:25:09 -0700 [thread overview]
Message-ID: <10559607091816@kroah.com> (raw)
In-Reply-To: <10559607092693@kroah.com>
ChangeSet 1.1318.3.8, 2003/06/17 15:37:40-07:00, greg@kroah.com
I2C: fix resource leak in i2c-ali15x3.c
drivers/i2c/busses/i2c-ali15x3.c | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
diff -Nru a/drivers/i2c/busses/i2c-ali15x3.c b/drivers/i2c/busses/i2c-ali15x3.c
--- a/drivers/i2c/busses/i2c-ali15x3.c Wed Jun 18 11:19:16 2003
+++ b/drivers/i2c/busses/i2c-ali15x3.c Wed Jun 18 11:19:16 2003
@@ -177,17 +177,18 @@
if(force_addr) {
dev_info(&ALI15X3_dev->dev, "forcing ISA address 0x%04X\n",
ali15x3_smba);
- if (PCIBIOS_SUCCESSFUL !=
- pci_write_config_word(ALI15X3_dev, SMBBA, ali15x3_smba))
- return -ENODEV;
- if (PCIBIOS_SUCCESSFUL !=
- pci_read_config_word(ALI15X3_dev, SMBBA, &a))
- return -ENODEV;
+ if (PCIBIOS_SUCCESSFUL != pci_write_config_word(ALI15X3_dev,
+ SMBBA,
+ ali15x3_smba))
+ goto error;
+ if (PCIBIOS_SUCCESSFUL != pci_read_config_word(ALI15X3_dev,
+ SMBBA, &a))
+ goto error;
if ((a & ~(ALI15X3_SMB_IOSIZE - 1)) != ali15x3_smba) {
/* make sure it works */
dev_err(&ALI15X3_dev->dev,
"force address failed - not supported?\n");
- return -ENODEV;
+ goto error;
}
}
/* check if whole device is enabled */
@@ -219,6 +220,9 @@
dev_dbg(&ALI15X3_dev->dev, "iALI15X3_smba = 0x%X\n", ali15x3_smba);
return 0;
+error:
+ release_region(ali15x3_smba, ALI15X3_SMB_IOSIZE);
+ return -ENODEV;
}
/* Internally used pause function */
prev parent reply other threads:[~2003-06-18 18:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-18 18:24 [BK PATCH] i2c driver changes for 2.5.72 Greg KH
2003-06-18 18:25 ` [PATCH] " Greg KH
2003-06-18 18:25 ` Greg KH
2003-06-18 18:25 ` Greg KH
2003-06-18 18:25 ` Greg KH
2003-06-18 18:25 ` Greg KH
2003-06-18 18:25 ` Greg KH
2003-06-18 18:25 ` Greg KH
2003-06-18 18:25 ` Greg KH [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=10559607091816@kroah.com \
--to=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sensors@stimpy.netroedge.com \
/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