提交 981c65a9 编写于 作者: J Julia Lawall 提交者: Samuel Ortiz

mfd: Clean timberdale error handling code up

In the first three cases, ioremap has been called, so iounmap is needed.  A
new label for this is introduced, to differentiate it from err_msix, which
is the first point at which msix_entries actually needs to be freed.
Signed-off-by: NJulia Lawall <julia@diku.dk>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 54d8e2c3
...@@ -697,7 +697,7 @@ static int __devinit timb_probe(struct pci_dev *dev, ...@@ -697,7 +697,7 @@ static int __devinit timb_probe(struct pci_dev *dev,
dev_err(&dev->dev, "The driver supports an older " dev_err(&dev->dev, "The driver supports an older "
"version of the FPGA, please update the driver to " "version of the FPGA, please update the driver to "
"support %d.%d\n", priv->fw.major, priv->fw.minor); "support %d.%d\n", priv->fw.major, priv->fw.minor);
goto err_ioremap; goto err_config;
} }
if (priv->fw.major < TIMB_SUPPORTED_MAJOR || if (priv->fw.major < TIMB_SUPPORTED_MAJOR ||
priv->fw.minor < TIMB_REQUIRED_MINOR) { priv->fw.minor < TIMB_REQUIRED_MINOR) {
...@@ -705,13 +705,13 @@ static int __devinit timb_probe(struct pci_dev *dev, ...@@ -705,13 +705,13 @@ static int __devinit timb_probe(struct pci_dev *dev,
"please upgrade the FPGA to at least: %d.%d\n", "please upgrade the FPGA to at least: %d.%d\n",
priv->fw.major, priv->fw.minor, priv->fw.major, priv->fw.minor,
TIMB_SUPPORTED_MAJOR, TIMB_REQUIRED_MINOR); TIMB_SUPPORTED_MAJOR, TIMB_REQUIRED_MINOR);
goto err_ioremap; goto err_config;
} }
msix_entries = kzalloc(TIMBERDALE_NR_IRQS * sizeof(*msix_entries), msix_entries = kzalloc(TIMBERDALE_NR_IRQS * sizeof(*msix_entries),
GFP_KERNEL); GFP_KERNEL);
if (!msix_entries) if (!msix_entries)
goto err_ioremap; goto err_config;
for (i = 0; i < TIMBERDALE_NR_IRQS; i++) for (i = 0; i < TIMBERDALE_NR_IRQS; i++)
msix_entries[i].entry = i; msix_entries[i].entry = i;
...@@ -825,6 +825,8 @@ static int __devinit timb_probe(struct pci_dev *dev, ...@@ -825,6 +825,8 @@ static int __devinit timb_probe(struct pci_dev *dev,
err_create_file: err_create_file:
pci_disable_msix(dev); pci_disable_msix(dev);
err_msix: err_msix:
kfree(msix_entries);
err_config:
iounmap(priv->ctl_membase); iounmap(priv->ctl_membase);
err_ioremap: err_ioremap:
release_mem_region(priv->ctl_mapbase, CHIPCTLSIZE); release_mem_region(priv->ctl_mapbase, CHIPCTLSIZE);
...@@ -833,7 +835,6 @@ static int __devinit timb_probe(struct pci_dev *dev, ...@@ -833,7 +835,6 @@ static int __devinit timb_probe(struct pci_dev *dev,
err_start: err_start:
pci_disable_device(dev); pci_disable_device(dev);
err_enable: err_enable:
kfree(msix_entries);
kfree(priv); kfree(priv);
pci_set_drvdata(dev, NULL); pci_set_drvdata(dev, NULL);
return -ENODEV; return -ENODEV;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册