diff options
author | Oleg Drokin <green@linuxhacker.ru> | 2011-03-10 20:17:27 -0500 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2011-03-14 18:30:57 -0400 |
commit | d838d2c09af0820e306e3e9e31f97e873823b0b4 (patch) | |
tree | b51cb6854bac7282c925f67b612ee22e946445c2 /drivers/firewire | |
parent | b6258fc1feabda868694ad5fdc7ca8edf3ef30ec (diff) |
firewire: ohci: Misleading kfree in ohci.c::pci_probe/remove
It seems drivers/firewire/ohci.c is making some optimistic assumptions
about struct fw_ohci and that member "card" will always remain the first
member of the struct.
Plus it's probably going to confuse a lot of static code analyzers too.
So I wonder if there is a good reason not to free the ohci struct just
like it was allocated instead of the tricky &ohci->card way?
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
It is perhaps just a rudiment from before mainline submission of the
driver.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire')
-rw-r--r-- | drivers/firewire/ohci.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 8f1e3ce930d6..f903d7b6f34a 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
@@ -3309,7 +3309,7 @@ static int __devinit pci_probe(struct pci_dev *dev, | |||
3309 | fail_disable: | 3309 | fail_disable: |
3310 | pci_disable_device(dev); | 3310 | pci_disable_device(dev); |
3311 | fail_free: | 3311 | fail_free: |
3312 | kfree(&ohci->card); | 3312 | kfree(ohci); |
3313 | pmac_ohci_off(dev); | 3313 | pmac_ohci_off(dev); |
3314 | fail: | 3314 | fail: |
3315 | if (err == -ENOMEM) | 3315 | if (err == -ENOMEM) |
@@ -3353,7 +3353,7 @@ static void pci_remove(struct pci_dev *dev) | |||
3353 | pci_iounmap(dev, ohci->registers); | 3353 | pci_iounmap(dev, ohci->registers); |
3354 | pci_release_region(dev, 0); | 3354 | pci_release_region(dev, 0); |
3355 | pci_disable_device(dev); | 3355 | pci_disable_device(dev); |
3356 | kfree(&ohci->card); | 3356 | kfree(ohci); |
3357 | pmac_ohci_off(dev); | 3357 | pmac_ohci_off(dev); |
3358 | 3358 | ||
3359 | fw_notify("Removed fw-ohci device.\n"); | 3359 | fw_notify("Removed fw-ohci device.\n"); |