Commit ae16b852 authored by Daniele Bellucci's avatar Daniele Bellucci Committed by Greg Kroah-Hartman

[PATCH] I2C: fixed a little memory leak in i2c-ali15x3.c

there is a little memory leak in i2c-ali15x3.c .
You can reproduce the BUG as follows:
In a PC with no such device unloading i2c-ali15x3 cause an oops in release_region.
I've fixed by moving release_region() from i2c_ali15x3_exit() to ali15x3_remove().
parent adc5fc04
......@@ -508,6 +508,7 @@ static int __devinit ali15x3_probe(struct pci_dev *dev, const struct pci_device_
static void __devexit ali15x3_remove(struct pci_dev *dev)
{
i2c_del_adapter(&ali15x3_adapter);
release_region(ali15x3_smba, ALI15X3_SMB_IOSIZE);
}
static struct pci_driver ali15x3_driver = {
......@@ -526,7 +527,6 @@ static int __init i2c_ali15x3_init(void)
static void __exit i2c_ali15x3_exit(void)
{
pci_unregister_driver(&ali15x3_driver);
release_region(ali15x3_smba, ALI15X3_SMB_IOSIZE);
}
MODULE_AUTHOR ("Frodo Looijaard <frodol@dds.nl>, "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment