Displaying 19 results from an estimated 19 matches for "drmm_add_final_kfree".
2020 Mar 02
2
[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);
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:
- kfree(cirrus);
err_pci_release:
pci_release_regions(pd...
2020 Mar 02
2
[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);
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:
- kfree(cirrus);
err_pci_release:
pci_release_regions(pd...
2020 Mar 02
1
[PATCH 07/51] drm/qxl: Use drmm_add_final_kfree
...m_drv.h>
+#include <drm/drm_managed.h>
#include <drm/drm_probe_helper.h>
#include "qxl_drv.h"
@@ -121,6 +122,7 @@ int qxl_device_init(struct qxl_device *qdev,
qdev->ddev.pdev = pdev;
pci_set_drvdata(pdev, &qdev->ddev);
qdev->ddev.dev_private = qdev;
+ drmm_add_final_kfree(&qdev->ddev, qdev);
mutex_init(&qdev->gem.mutex);
mutex_init(&qdev->update_area_mutex);
--
2.24.1
2020 Feb 19
0
[PATCH 08/52] drm/qxl: Use drmm_add_final_kfree
...m_drv.h>
+#include <drm/drm_managed.h>
#include <drm/drm_probe_helper.h>
#include "qxl_drv.h"
@@ -121,6 +122,7 @@ int qxl_device_init(struct qxl_device *qdev,
qdev->ddev.pdev = pdev;
pci_set_drvdata(pdev, &qdev->ddev);
qdev->ddev.dev_private = qdev;
+ drmm_add_final_kfree(&qdev->ddev, qdev);
mutex_init(&qdev->gem.mutex);
mutex_init(&qdev->update_area_mutex);
--
2.24.1
2020 Feb 19
0
[PATCH 10/52] 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);
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:
- kfree(cirrus);
err_pci_release:
pci_release_regions(pd...
2020 Mar 03
0
[PATCH 09/51] drm/cirrus: Use drmm_add_final_kfree
...ct 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>
cheers,
Gerd
2020 Apr 03
2
[PATCH 39/44] drm/cirrus: Use devm_drm_dev_alloc
...gt;dev, &cirrus_driver,
+ struct cirrus_device, dev);
+ if (IS_ERR(cirrus))
+ return PTR_ERR(cirrus);
dev = &cirrus->dev;
- ret = devm_drm_dev_init(&pdev->dev, dev, &cirrus_driver);
- if (ret) {
- kfree(cirrus);
- return ret;
- }
dev->dev_private = cirrus;
- drmm_add_final_kfree(dev, cirrus);
cirrus->vram = devm_ioremap(&pdev->dev, pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0));
--
2.25.1
2020 Apr 15
2
[PATCH 26/59] drm/qxl: Use devm_drm_dev_alloc
...struct pci_dev *pdev)
{
int r, sb;
- r = drm_dev_init(&qdev->ddev, drv, &pdev->dev);
- if (r) {
- pr_err("Unable to init drm dev");
- goto error;
- }
-
qdev->ddev.pdev = pdev;
pci_set_drvdata(pdev, &qdev->ddev);
qdev->ddev.dev_private = qdev;
- drmm_add_final_kfree(&qdev->ddev, qdev);
mutex_init(&qdev->gem.mutex);
mutex_init(&qdev->update_area_mutex);
@@ -138,8 +130,7 @@ int qxl_device_init(struct qxl_device *qdev,
qdev->vram_mapping = io_mapping_create_wc(qdev->vram_base, pci_resource_len(pdev, 0));
if (!qdev->vram_map...
2020 Apr 15
2
[PATCH 26/59] drm/qxl: Use devm_drm_dev_alloc
...struct pci_dev *pdev)
{
int r, sb;
- r = drm_dev_init(&qdev->ddev, drv, &pdev->dev);
- if (r) {
- pr_err("Unable to init drm dev");
- goto error;
- }
-
qdev->ddev.pdev = pdev;
pci_set_drvdata(pdev, &qdev->ddev);
qdev->ddev.dev_private = qdev;
- drmm_add_final_kfree(&qdev->ddev, qdev);
mutex_init(&qdev->gem.mutex);
mutex_init(&qdev->update_area_mutex);
@@ -138,8 +130,7 @@ int qxl_device_init(struct qxl_device *qdev,
qdev->vram_mapping = io_mapping_create_wc(qdev->vram_base, pci_resource_len(pdev, 0));
if (!qdev->vram_map...
2020 Apr 03
3
[PATCH 30/44] drm/qxl: Use devm_drm_dev_alloc
...struct pci_dev *pdev)
{
int r, sb;
- r = drm_dev_init(&qdev->ddev, drv, &pdev->dev);
- if (r) {
- pr_err("Unable to init drm dev");
- goto error;
- }
-
qdev->ddev.pdev = pdev;
pci_set_drvdata(pdev, &qdev->ddev);
qdev->ddev.dev_private = qdev;
- drmm_add_final_kfree(&qdev->ddev, qdev);
mutex_init(&qdev->gem.mutex);
mutex_init(&qdev->update_area_mutex);
@@ -138,8 +130,7 @@ int qxl_device_init(struct qxl_device *qdev,
qdev->vram_mapping = io_mapping_create_wc(qdev->vram_base, pci_resource_len(pdev, 0));
if (!qdev->vram_map...
2020 Apr 03
3
[PATCH 30/44] drm/qxl: Use devm_drm_dev_alloc
...struct pci_dev *pdev)
{
int r, sb;
- r = drm_dev_init(&qdev->ddev, drv, &pdev->dev);
- if (r) {
- pr_err("Unable to init drm dev");
- goto error;
- }
-
qdev->ddev.pdev = pdev;
pci_set_drvdata(pdev, &qdev->ddev);
qdev->ddev.dev_private = qdev;
- drmm_add_final_kfree(&qdev->ddev, qdev);
mutex_init(&qdev->gem.mutex);
mutex_init(&qdev->update_area_mutex);
@@ -138,8 +130,7 @@ int qxl_device_init(struct qxl_device *qdev,
qdev->vram_mapping = io_mapping_create_wc(qdev->vram_base, pci_resource_len(pdev, 0));
if (!qdev->vram_map...
2020 Apr 28
2
[PATCH 26/59] drm/qxl: Use devm_drm_dev_alloc
...amp;pdev->dev);
> > - if (r) {
> > - pr_err("Unable to init drm dev");
> > - goto error;
> > - }
> > -
> > qdev->ddev.pdev = pdev;
> > pci_set_drvdata(pdev, &qdev->ddev);
> > qdev->ddev.dev_private = qdev;
> > - drmm_add_final_kfree(&qdev->ddev, qdev);
> >
> > mutex_init(&qdev->gem.mutex);
> > mutex_init(&qdev->update_area_mutex);
> > @@ -138,8 +130,7 @@ int qxl_device_init(struct qxl_device *qdev,
> > qdev->vram_mapping = io_mapping_create_wc(qdev->vram_base, pc...
2020 Apr 28
2
[PATCH 26/59] drm/qxl: Use devm_drm_dev_alloc
...amp;pdev->dev);
> > - if (r) {
> > - pr_err("Unable to init drm dev");
> > - goto error;
> > - }
> > -
> > qdev->ddev.pdev = pdev;
> > pci_set_drvdata(pdev, &qdev->ddev);
> > qdev->ddev.dev_private = qdev;
> > - drmm_add_final_kfree(&qdev->ddev, qdev);
> >
> > mutex_init(&qdev->gem.mutex);
> > mutex_init(&qdev->update_area_mutex);
> > @@ -138,8 +130,7 @@ int qxl_device_init(struct qxl_device *qdev,
> > qdev->vram_mapping = io_mapping_create_wc(qdev->vram_base, pc...
2020 Apr 15
0
[PATCH 35/59] drm/cirrus: Use devm_drm_dev_alloc
...gt;dev, &cirrus_driver,
+ struct cirrus_device, dev);
+ if (IS_ERR(cirrus))
+ return PTR_ERR(cirrus);
dev = &cirrus->dev;
- ret = devm_drm_dev_init(&pdev->dev, dev, &cirrus_driver);
- if (ret) {
- kfree(cirrus);
- return ret;
- }
dev->dev_private = cirrus;
- drmm_add_final_kfree(dev, cirrus);
cirrus->vram = devm_ioremap(&pdev->dev, pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0));
--
2.25.1
2020 Feb 19
0
[PATCH 31/52] drm/cirrus: Fully embrace devm_
...elease;
+ 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_add_final_kfree(dev, cirrus);
- ret = -ENOMEM;
- cirrus->vram = ioremap(pci_resource_start(pdev, 0),
- pci_resource_len(pdev, 0));
+ cirrus->vram = devm_ioremap(&pdev->dev, pci_resource_start(pdev, 0),
+ pci_resource_len(pdev, 0));
if (cirrus->vram == NULL)
- goto err_dev_put;...
2020 Mar 02
1
[PATCH 30/51] drm/cirrus: Fully embrace devm_
...elease;
+ 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_add_final_kfree(dev, cirrus);
- ret = -ENOMEM;
- cirrus->vram = ioremap(pci_resource_start(pdev, 0),
- pci_resource_len(pdev, 0));
+ cirrus->vram = devm_ioremap(&pdev->dev, pci_resource_start(pdev, 0),
+ pci_resource_len(pdev, 0));
if (cirrus->vram == NULL)
- goto err_dev_put;...
2020 Apr 24
0
[PATCH 26/59] drm/qxl: Use devm_drm_dev_alloc
...- r = drm_dev_init(&qdev->ddev, drv, &pdev->dev);
> - if (r) {
> - pr_err("Unable to init drm dev");
> - goto error;
> - }
> -
> qdev->ddev.pdev = pdev;
> pci_set_drvdata(pdev, &qdev->ddev);
> qdev->ddev.dev_private = qdev;
> - drmm_add_final_kfree(&qdev->ddev, qdev);
>
> mutex_init(&qdev->gem.mutex);
> mutex_init(&qdev->update_area_mutex);
> @@ -138,8 +130,7 @@ int qxl_device_init(struct qxl_device *qdev,
> qdev->vram_mapping = io_mapping_create_wc(qdev->vram_base, pci_resource_len(pdev, 0));...
2020 Apr 06
0
[PATCH 30/44] drm/qxl: Use devm_drm_dev_alloc
...- r = drm_dev_init(&qdev->ddev, drv, &pdev->dev);
> - if (r) {
> - pr_err("Unable to init drm dev");
> - goto error;
> - }
> -
> qdev->ddev.pdev = pdev;
> pci_set_drvdata(pdev, &qdev->ddev);
> qdev->ddev.dev_private = qdev;
> - drmm_add_final_kfree(&qdev->ddev, qdev);
>
> mutex_init(&qdev->gem.mutex);
> mutex_init(&qdev->update_area_mutex);
> @@ -138,8 +130,7 @@ int qxl_device_init(struct qxl_device *qdev,
> qdev->vram_mapping = io_mapping_create_wc(qdev->vram_base, pci_resource_len(pdev, 0));...
2020 Apr 28
0
[PATCH 26/59] drm/qxl: Use devm_drm_dev_alloc
...> > > - pr_err("Unable to init drm dev");
> > > - goto error;
> > > - }
> > > -
> > > qdev->ddev.pdev = pdev;
> > > pci_set_drvdata(pdev, &qdev->ddev);
> > > qdev->ddev.dev_private = qdev;
> > > - drmm_add_final_kfree(&qdev->ddev, qdev);
> > >
> > > mutex_init(&qdev->gem.mutex);
> > > mutex_init(&qdev->update_area_mutex);
> > > @@ -138,8 +130,7 @@ int qxl_device_init(struct qxl_device *qdev,
> > > qdev->vram_mapping = io_mapping_create_...