Displaying 20 results from an estimated 29 matches for "err_unref".
2023 Feb 14
3
[PATCH] drm/gem: Expose the buffer object handle to userspace last
...ck.
*/
idr_preload(GFP_KERNEL);
spin_lock(&file_priv->table_lock);
-
ret = idr_alloc(&file_priv->object_idr, obj, 1, 0, GFP_NOWAIT);
-
spin_unlock(&file_priv->table_lock);
idr_preload_end();
- mutex_unlock(&dev->object_name_lock);
if (ret < 0)
- goto err_unref;
-
- handle = ret;
+ goto err_close;
- ret = drm_vma_node_allow(&obj->vma_node, file_priv);
- if (ret)
- goto err_remove;
+ mutex_unlock(&dev->object_name_lock);
- if (obj->funcs->open) {
- ret = obj->funcs->open(obj, file_priv);
- if (ret)
- goto err_revoke;
- }...
2023 Feb 14
3
[PATCH] drm/gem: Expose the buffer object handle to userspace last
...ck.
*/
idr_preload(GFP_KERNEL);
spin_lock(&file_priv->table_lock);
-
ret = idr_alloc(&file_priv->object_idr, obj, 1, 0, GFP_NOWAIT);
-
spin_unlock(&file_priv->table_lock);
idr_preload_end();
- mutex_unlock(&dev->object_name_lock);
if (ret < 0)
- goto err_unref;
-
- handle = ret;
+ goto err_close;
- ret = drm_vma_node_allow(&obj->vma_node, file_priv);
- if (ret)
- goto err_remove;
+ mutex_unlock(&dev->object_name_lock);
- if (obj->funcs->open) {
- ret = obj->funcs->open(obj, file_priv);
- if (ret)
- goto err_revoke;
- }...
2023 Feb 20
2
[PATCH] drm/gem: Expose the buffer object handle to userspace last
...;> ????? ret = idr_alloc(&file_priv->object_idr, obj, 1, 0, GFP_NOWAIT);
>> -
>> ????? spin_unlock(&file_priv->table_lock);
>> ????? idr_preload_end();
>> -??? mutex_unlock(&dev->object_name_lock);
>> ????? if (ret < 0)
>> -??????? goto err_unref;
>> -
>> -??? handle = ret;
>> +??????? goto err_close;
>> -??? ret = drm_vma_node_allow(&obj->vma_node, file_priv);
>> -??? if (ret)
>> -??????? goto err_remove;
>> +??? mutex_unlock(&dev->object_name_lock);
>> -??? if (obj->funcs-&g...
2023 Feb 20
2
[PATCH] drm/gem: Expose the buffer object handle to userspace last
...;> ????? ret = idr_alloc(&file_priv->object_idr, obj, 1, 0, GFP_NOWAIT);
>> -
>> ????? spin_unlock(&file_priv->table_lock);
>> ????? idr_preload_end();
>> -??? mutex_unlock(&dev->object_name_lock);
>> ????? if (ret < 0)
>> -??????? goto err_unref;
>> -
>> -??? handle = ret;
>> +??????? goto err_close;
>> -??? ret = drm_vma_node_allow(&obj->vma_node, file_priv);
>> -??? if (ret)
>> -??????? goto err_remove;
>> +??? mutex_unlock(&dev->object_name_lock);
>> -??? if (obj->funcs-&g...
2013 Aug 22
6
[PATCH] drm/nouveau: avoid null deref on bad arguments to nouveau_vma_getmap
The code expects non-VRAM mem nodes to have a pages list. If that's not
set, it will do a null deref down the line. Warn on that condition and
return an error.
See https://bugs.freedesktop.org/show_bug.cgi?id=64774
Reported-by: Pasi K?rkk?inen <pasik at iki.fi>
Tested-by: Pasi K?rkk?inen <pasik at iki.fi>
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Cc: <stable
2013 Sep 04
4
[PATCH] drm/nouveau: avoid null deref on bad arguments to nouveau_vma_getmap
...bo->valid_domains & NOUVEAU_GEM_DOMAIN_VRAM)) {
> + nv_warn(nouveau_drm(dev), "Trying to create a fb in vram with"
> + " valid_domains=%08x\n", nvbo->valid_domains);
> + ret = -EINVAL;
> + goto err_unref;
> + }
> +
Definitely the right idea, we can't handle this case right now.
However, we may someday want/need to be able to scan out of system
memory, so this is the wrong place.
I suspect the correct thing to do (which'll also handle the
"defensive" part) is to bail i...
2013 Aug 22
0
[PATCH] drm/nouveau: avoid null deref on bad arguments to nouveau_vma_getmap
...gem)
return ERR_PTR(-ENOENT);
+ nvbo = nouveau_gem_object(gem);
+ if (!(nvbo->valid_domains & NOUVEAU_GEM_DOMAIN_VRAM)) {
+ nv_warn(nouveau_drm(dev), "Trying to create a fb in vram with"
+ " valid_domains=%08x\n", nvbo->valid_domains);
+ ret = -EINVAL;
+ goto err_unref;
+ }
+
nouveau_fb = kzalloc(sizeof(struct nouveau_framebuffer), GFP_KERNEL);
if (!nouveau_fb)
goto err_unref;
- ret = nouveau_framebuffer_init(dev, nouveau_fb, mode_cmd, nouveau_gem_object(gem));
+ ret = nouveau_framebuffer_init(dev, nouveau_fb, mode_cmd, nvbo);
if (ret)
goto err;
2013 Jul 02
0
[PATCH] drm/nouveau: handle framebuffer pinning correctly
...s/gpu/drm/nouveau/nouveau_display.c
@@ -142,17 +142,22 @@ nouveau_user_framebuffer_create(struct drm_device *dev,
if (!gem)
return ERR_PTR(-ENOENT);
+ ret = -ENOMEM;
nouveau_fb = kzalloc(sizeof(struct nouveau_framebuffer), GFP_KERNEL);
if (!nouveau_fb)
- return ERR_PTR(-ENOMEM);
+ goto err_unref;
ret = nouveau_framebuffer_init(dev, nouveau_fb, mode_cmd, nouveau_gem_object(gem));
- if (ret) {
- drm_gem_object_unreference(gem);
- return ERR_PTR(ret);
- }
+ if (ret)
+ goto err;
return &nouveau_fb->base;
+
+err:
+ kfree(nouveau_fb);
+err_unref:
+ drm_gem_object_unreference(ge...
2023 Feb 20
1
[PATCH] drm/gem: Expose the buffer object handle to userspace last
...bject_idr, obj, 1, 0, GFP_NOWAIT);
>>>> -
>>>> ????? spin_unlock(&file_priv->table_lock);
>>>> ????? idr_preload_end();
>>>> -??? mutex_unlock(&dev->object_name_lock);
>>>> ????? if (ret < 0)
>>>> -??????? goto err_unref;
>>>> -
>>>> -??? handle = ret;
>>>> +??????? goto err_close;
>>>> -??? ret = drm_vma_node_allow(&obj->vma_node, file_priv);
>>>> -??? if (ret)
>>>> -??????? goto err_remove;
>>>> +??? mutex_unlock(&dev-&...
2023 Feb 20
1
[PATCH] drm/gem: Expose the buffer object handle to userspace last
...bject_idr, obj, 1, 0, GFP_NOWAIT);
>>>> -
>>>> ????? spin_unlock(&file_priv->table_lock);
>>>> ????? idr_preload_end();
>>>> -??? mutex_unlock(&dev->object_name_lock);
>>>> ????? if (ret < 0)
>>>> -??????? goto err_unref;
>>>> -
>>>> -??? handle = ret;
>>>> +??????? goto err_close;
>>>> -??? ret = drm_vma_node_allow(&obj->vma_node, file_priv);
>>>> -??? if (ret)
>>>> -??????? goto err_remove;
>>>> +??? mutex_unlock(&dev-&...
2023 Feb 14
0
[PATCH] drm/gem: Expose the buffer object handle to userspace last
...amp;file_priv->table_lock);
> -
> ret = idr_alloc(&file_priv->object_idr, obj, 1, 0, GFP_NOWAIT);
> -
> spin_unlock(&file_priv->table_lock);
> idr_preload_end();
>
> - mutex_unlock(&dev->object_name_lock);
> if (ret < 0)
> - goto err_unref;
> -
> - handle = ret;
> + goto err_close;
>
> - ret = drm_vma_node_allow(&obj->vma_node, file_priv);
> - if (ret)
> - goto err_remove;
> + mutex_unlock(&dev->object_name_lock);
>
> - if (obj->funcs->open) {
> - ret = obj->funcs->o...
2023 Feb 14
0
[Nouveau] [PATCH] drm/gem: Expose the buffer object handle to userspace last
...amp;file_priv->table_lock);
> -
> ret = idr_alloc(&file_priv->object_idr, obj, 1, 0, GFP_NOWAIT);
> -
> spin_unlock(&file_priv->table_lock);
> idr_preload_end();
>
> - mutex_unlock(&dev->object_name_lock);
> if (ret < 0)
> - goto err_unref;
> -
> - handle = ret;
> + goto err_close;
>
> - ret = drm_vma_node_allow(&obj->vma_node, file_priv);
> - if (ret)
> - goto err_remove;
> + mutex_unlock(&dev->object_name_lock);
>
> - if (obj->funcs->open) {
> - ret = obj->funcs->o...
2013 Sep 25
3
[PATCH] drm/nouveau: avoid null deref on bad arguments to nouveau_vma_getmap
...EM_DOMAIN_VRAM)) {
> >> + nv_warn(nouveau_drm(dev), "Trying to create a fb in vram with"
> >> + " valid_domains=%08x\n", nvbo->valid_domains);
> >> + ret = -EINVAL;
> >> + goto err_unref;
> >> + }
> >> +
> > Definitely the right idea, we can't handle this case right now.
> > However, we may someday want/need to be able to scan out of system
> > memory, so this is the wrong place.
> >
> > I suspect the correct thing to do (wh...
2023 Feb 20
0
[Nouveau] [PATCH] drm/gem: Expose the buffer object handle to userspace last
...loc(&file_priv->object_idr, obj, 1, 0, GFP_NOWAIT);
>>> -
>>> ????? spin_unlock(&file_priv->table_lock);
>>> ????? idr_preload_end();
>>> -??? mutex_unlock(&dev->object_name_lock);
>>> ????? if (ret < 0)
>>> -??????? goto err_unref;
>>> -
>>> -??? handle = ret;
>>> +??????? goto err_close;
>>> -??? ret = drm_vma_node_allow(&obj->vma_node, file_priv);
>>> -??? if (ret)
>>> -??????? goto err_remove;
>>> +??? mutex_unlock(&dev->object_name_lock);
>&g...
2018 Apr 26
0
[Intel-gfx] [PATCH] drm/core: Remove drm_dev_unref() and it's uses
...arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
> index f067de4e1e82..dcb06d4e9135 100644
> --- a/drivers/gpu/drm/arc/arcpgu_drv.c
> +++ b/drivers/gpu/drm/arc/arcpgu_drv.c
> @@ -216,7 +216,7 @@ static int arcpgu_probe(struct platform_device *pdev)
> arcpgu_unload(drm);
>
> err_unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return ret;
> }
> @@ -227,7 +227,7 @@ static int arcpgu_remove(struct platform_device *pdev)
>
> drm_dev_unregister(drm);
> arcpgu_unload(drm);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
>...
2014 Jun 26
0
[PATCH v3 1/3] drm/nouveau: support for probing platform devices
...->clk_pwr);
+
+ err = nouveau_platform_power_up(gpu);
+ if (err)
+ return err;
+
+ drm = nouveau_platform_device_create(pdev, &device);
+ if (IS_ERR(drm)) {
+ err = PTR_ERR(drm);
+ goto power_down;
+ }
+
+ device->gpu = gpu;
+
+ err = drm_dev_register(drm, 0);
+ if (err < 0)
+ goto err_unref;
+
+ return 0;
+
+err_unref:
+ drm_dev_unref(drm);
+
+ return 0;
+
+power_down:
+ nouveau_platform_power_down(gpu);
+
+ return err;
+}
+
+static int nouveau_platform_remove(struct platform_device *pdev)
+{
+ struct drm_device *drm_dev = platform_get_drvdata(pdev);
+ struct nouveau_device *device =...
2018 Apr 26
5
[PATCH] drm/core: Remove drm_dev_unref() and it's uses
...}
diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
index f067de4e1e82..dcb06d4e9135 100644
--- a/drivers/gpu/drm/arc/arcpgu_drv.c
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -216,7 +216,7 @@ static int arcpgu_probe(struct platform_device *pdev)
arcpgu_unload(drm);
err_unref:
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return ret;
}
@@ -227,7 +227,7 @@ static int arcpgu_remove(struct platform_device *pdev)
drm_dev_unregister(drm);
arcpgu_unload(drm);
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return 0;
}
diff --git a/drivers/gpu/drm/armada/armada_drv.c b/d...
2018 Apr 26
5
[PATCH] drm/core: Remove drm_dev_unref() and it's uses
...}
diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
index f067de4e1e82..dcb06d4e9135 100644
--- a/drivers/gpu/drm/arc/arcpgu_drv.c
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -216,7 +216,7 @@ static int arcpgu_probe(struct platform_device *pdev)
arcpgu_unload(drm);
err_unref:
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return ret;
}
@@ -227,7 +227,7 @@ static int arcpgu_remove(struct platform_device *pdev)
drm_dev_unregister(drm);
arcpgu_unload(drm);
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return 0;
}
diff --git a/drivers/gpu/drm/armada/armada_drv.c b/d...
2018 Apr 26
5
[PATCH] drm/core: Remove drm_dev_unref() and it's uses
...}
diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
index f067de4e1e82..dcb06d4e9135 100644
--- a/drivers/gpu/drm/arc/arcpgu_drv.c
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -216,7 +216,7 @@ static int arcpgu_probe(struct platform_device *pdev)
arcpgu_unload(drm);
err_unref:
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return ret;
}
@@ -227,7 +227,7 @@ static int arcpgu_remove(struct platform_device *pdev)
drm_dev_unregister(drm);
arcpgu_unload(drm);
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return 0;
}
diff --git a/drivers/gpu/drm/armada/armada_drv.c b/d...
2015 Mar 20
2
[PATCH 1/3] platform: release IOMMU's mm upon exit
nvkm_mm_fini() was not called when exiting the driver, resulting in a
memory leak. Fix this.
Signed-off-by: Alexandre Courbot <acourbot at nvidia.com>
---
drm/nouveau/nouveau_platform.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drm/nouveau/nouveau_platform.c b/drm/nouveau/nouveau_platform.c
index 3691982452a9..f83aa12ee5c6 100644
--- a/drm/nouveau/nouveau_platform.c
+++