search for: err_pci_release

Displaying 11 results from an estimated 11 matches for "err_pci_release".

2020 Mar 02
2
[PATCH 09/51] drm/cirrus: Use drmm_add_final_kfree
...m_dev_fini(dev); } DEFINE_DRM_GEM_FOPS(cirrus_fops); @@ -575,9 +574,12 @@ static int cirrus_pci_probe(struct pci_dev *pdev, dev = &cirrus->dev; ret = drm_dev_init(dev, &cirrus_driver, &pdev->dev); - if (ret) - goto err_free_cirrus; + if (ret) { + kfree(cirrus); + goto err_pci_release; + } dev->dev_private = cirrus; + drmm_add_final_kfree(dev, cirrus); ret = -ENOMEM; cirrus->vram = ioremap(pci_resource_start(pdev, 0), @@ -618,8 +620,6 @@ static int cirrus_pci_probe(struct pci_dev *pdev, iounmap(cirrus->vram); err_dev_put: drm_dev_put(dev); -err_free_cirrus:...
2020 Mar 02
2
[PATCH 09/51] drm/cirrus: Use drmm_add_final_kfree
...m_dev_fini(dev); } DEFINE_DRM_GEM_FOPS(cirrus_fops); @@ -575,9 +574,12 @@ static int cirrus_pci_probe(struct pci_dev *pdev, dev = &cirrus->dev; ret = drm_dev_init(dev, &cirrus_driver, &pdev->dev); - if (ret) - goto err_free_cirrus; + if (ret) { + kfree(cirrus); + goto err_pci_release; + } dev->dev_private = cirrus; + drmm_add_final_kfree(dev, cirrus); ret = -ENOMEM; cirrus->vram = ioremap(pci_resource_start(pdev, 0), @@ -618,8 +620,6 @@ static int cirrus_pci_probe(struct pci_dev *pdev, iounmap(cirrus->vram); err_dev_put: drm_dev_put(dev); -err_free_cirrus:...
2020 Feb 19
0
[PATCH 31/52] drm/cirrus: Fully embrace devm_
...v *pdev, if (ret) return ret; - ret = pci_enable_device(pdev); + ret = pcim_enable_device(pdev); if (ret) return ret; @@ -569,39 +569,38 @@ static int cirrus_pci_probe(struct pci_dev *pdev, ret = -ENOMEM; cirrus = kzalloc(sizeof(*cirrus), GFP_KERNEL); if (cirrus == NULL) - goto err_pci_release; + return ret; dev = &cirrus->dev; - ret = drm_dev_init(dev, &cirrus_driver, &pdev->dev); + ret = devm_drm_dev_init(&pdev->dev, dev, &cirrus_driver); if (ret) { kfree(cirrus); - goto err_pci_release; + return ret; } dev->dev_private = cirrus; drmm_a...
2020 Mar 02
1
[PATCH 30/51] drm/cirrus: Fully embrace devm_
...v *pdev, if (ret) return ret; - ret = pci_enable_device(pdev); + ret = pcim_enable_device(pdev); if (ret) return ret; @@ -569,39 +569,38 @@ static int cirrus_pci_probe(struct pci_dev *pdev, ret = -ENOMEM; cirrus = kzalloc(sizeof(*cirrus), GFP_KERNEL); if (cirrus == NULL) - goto err_pci_release; + return ret; dev = &cirrus->dev; - ret = drm_dev_init(dev, &cirrus_driver, &pdev->dev); + ret = devm_drm_dev_init(&pdev->dev, dev, &cirrus_driver); if (ret) { kfree(cirrus); - goto err_pci_release; + return ret; } dev->dev_private = cirrus; drmm_a...
2020 Feb 19
0
[PATCH 10/52] drm/cirrus: Use drmm_add_final_kfree
...m_dev_fini(dev); } DEFINE_DRM_GEM_FOPS(cirrus_fops); @@ -575,9 +574,12 @@ static int cirrus_pci_probe(struct pci_dev *pdev, dev = &cirrus->dev; ret = drm_dev_init(dev, &cirrus_driver, &pdev->dev); - if (ret) - goto err_free_cirrus; + if (ret) { + kfree(cirrus); + goto err_pci_release; + } dev->dev_private = cirrus; + drmm_add_final_kfree(dev, cirrus); ret = -ENOMEM; cirrus->vram = ioremap(pci_resource_start(pdev, 0), @@ -618,8 +620,6 @@ static int cirrus_pci_probe(struct pci_dev *pdev, iounmap(cirrus->vram); err_dev_put: drm_dev_put(dev); -err_free_cirrus:...
2020 Mar 03
0
[PATCH 09/51] drm/cirrus: Use drmm_add_final_kfree
> @@ -575,9 +574,12 @@ static int cirrus_pci_probe(struct pci_dev *pdev, > > dev = &cirrus->dev; > ret = drm_dev_init(dev, &cirrus_driver, &pdev->dev); > - if (ret) > - goto err_free_cirrus; > + if (ret) { > + kfree(cirrus); > + goto err_pci_release; > + } > dev->dev_private = cirrus; > + drmm_add_final_kfree(dev, cirrus); That doesn't look like an error path improvement. With patch #30 applied it'll looks alot better though. So maybe squash the patches? In any case: Acked-by: Gerd Hoffmann <kraxel at redhat.com>...
2019 Apr 03
0
[PATCH] drm/cirrus: rewrite and modernize driver.
...oto err_free_dev; > + > + ret = pci_request_regions(pdev, DRIVER_NAME); > + if (ret) > + goto err_free_dev; > + > + ret = -ENOMEM; > + cirrus = kzalloc(sizeof(*cirrus), GFP_KERNEL); > + if (cirrus == NULL) > + goto err_pci_release; > + dev->dev_private = cirrus; > + cirrus->dev = dev; > + > + cirrus->vram = ioremap(pci_resource_start(pdev, 0), > + pci_resource_len(pdev, 0)); > + if (cirrus->vram == NULL) > + goto err_free_cirr...
2019 Apr 03
5
[PATCH] drm/cirrus: rewrite and modernize driver.
...t;dev); + if (IS_ERR(dev)) + return PTR_ERR(dev); + + ret = pci_enable_device(pdev); + if (ret) + goto err_free_dev; + + ret = pci_request_regions(pdev, DRIVER_NAME); + if (ret) + goto err_free_dev; + + ret = -ENOMEM; + cirrus = kzalloc(sizeof(*cirrus), GFP_KERNEL); + if (cirrus == NULL) + goto err_pci_release; + dev->dev_private = cirrus; + cirrus->dev = dev; + + cirrus->vram = ioremap(pci_resource_start(pdev, 0), + pci_resource_len(pdev, 0)); + if (cirrus->vram == NULL) + goto err_free_cirrus; + + cirrus->mmio = ioremap(pci_resource_start(pdev, 1), + pci_resource_len(p...
2019 Apr 03
5
[PATCH] drm/cirrus: rewrite and modernize driver.
...t;dev); + if (IS_ERR(dev)) + return PTR_ERR(dev); + + ret = pci_enable_device(pdev); + if (ret) + goto err_free_dev; + + ret = pci_request_regions(pdev, DRIVER_NAME); + if (ret) + goto err_free_dev; + + ret = -ENOMEM; + cirrus = kzalloc(sizeof(*cirrus), GFP_KERNEL); + if (cirrus == NULL) + goto err_pci_release; + dev->dev_private = cirrus; + cirrus->dev = dev; + + cirrus->vram = ioremap(pci_resource_start(pdev, 0), + pci_resource_len(pdev, 0)); + if (cirrus->vram == NULL) + goto err_free_cirrus; + + cirrus->mmio = ioremap(pci_resource_start(pdev, 1), + pci_resource_len(p...
2019 Apr 05
1
[PATCH v3 5/5] drm/cirrus: rewrite and modernize driver.
...ers(pdev, 0, "cirrusdrmfb"); + if (ret) + return ret; + + ret = pci_enable_device(pdev); + if (ret) + return ret; + + ret = pci_request_regions(pdev, DRIVER_NAME); + if (ret) + return ret; + + ret = -ENOMEM; + cirrus = kzalloc(sizeof(*cirrus), GFP_KERNEL); + if (cirrus == NULL) + goto err_pci_release; + + dev = &cirrus->dev; + ret = drm_dev_init(dev, &cirrus_driver, &pdev->dev); + if (ret) + goto err_free_cirrus; + dev->dev_private = cirrus; + + ret = -ENOMEM; + cirrus->vram = ioremap(pci_resource_start(pdev, 0), + pci_resource_len(pdev, 0)); + if (cirrus->v...
2019 Apr 04
1
[PATCH v2 6/6] drm/cirrus: rewrite and modernize driver.
...ers(pdev, 0, "cirrusdrmfb"); + if (ret) + return ret; + + ret = pci_enable_device(pdev); + if (ret) + return ret; + + ret = pci_request_regions(pdev, DRIVER_NAME); + if (ret) + return ret; + + ret = -ENOMEM; + cirrus = kzalloc(sizeof(*cirrus), GFP_KERNEL); + if (cirrus == NULL) + goto err_pci_release; + + dev = &cirrus->dev; + ret = drm_dev_init(dev, &cirrus_driver, &pdev->dev); + if (ret) + goto err_free_cirrus; + dev->dev_private = cirrus; + + ret = -ENOMEM; + cirrus->vram = ioremap(pci_resource_start(pdev, 0), + pci_resource_len(pdev, 0)); + if (cirrus->v...