* [PATCH] drm/amdgpu/virt: fix double kfree on bo_va
@ 2017-02-03 20:23 ` Colin King
0 siblings, 0 replies; 7+ messages in thread
From: Colin King @ 2017-02-03 20:23 UTC (permalink / raw)
To: Alex Deucher, Christian König, David Airlie, Monk Liu,
Xiangliang Yu, amd-gfx, dri-devel
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
bo_va is being kfree'd twice, once in the call to amdgpu_vm_bo_rmv
and then a short while later. Fix this double free by removing
the 2nd kfree.
Detected by CoverityScan, CID#1399524 ("Double Free")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
index 3fd951c..dcfb7df 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
@@ -83,7 +83,6 @@ int amdgpu_map_static_csa(struct amdgpu_device *adev, struct amdgpu_vm *vm)
DRM_ERROR("failed to do bo_map on static CSA, err=%d\n", r);
amdgpu_vm_bo_rmv(adev, bo_va);
ttm_eu_backoff_reservation(&ticket, &list);
- kfree(bo_va);
return r;
}
--
2.10.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] drm/amdgpu/virt: fix double kfree on bo_va
@ 2017-02-03 20:23 ` Colin King
0 siblings, 0 replies; 7+ messages in thread
From: Colin King @ 2017-02-03 20:23 UTC (permalink / raw)
To: Alex Deucher, Christian König, David Airlie, Monk Liu,
Xiangliang Yu, amd-gfx, dri-devel
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
bo_va is being kfree'd twice, once in the call to amdgpu_vm_bo_rmv
and then a short while later. Fix this double free by removing
the 2nd kfree.
Detected by CoverityScan, CID#1399524 ("Double Free")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
index 3fd951c..dcfb7df 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
@@ -83,7 +83,6 @@ int amdgpu_map_static_csa(struct amdgpu_device *adev, struct amdgpu_vm *vm)
DRM_ERROR("failed to do bo_map on static CSA, err=%d\n", r);
amdgpu_vm_bo_rmv(adev, bo_va);
ttm_eu_backoff_reservation(&ticket, &list);
- kfree(bo_va);
return r;
}
--
2.10.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] drm/amdgpu/virt: fix double kfree on bo_va
@ 2017-02-03 20:23 ` Colin King
0 siblings, 0 replies; 7+ messages in thread
From: Colin King @ 2017-02-03 20:23 UTC (permalink / raw)
To: Alex Deucher, Christian König, David Airlie, Monk Liu,
Xiangliang Yu, amd-gfx, dri-devel
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
bo_va is being kfree'd twice, once in the call to amdgpu_vm_bo_rmv
and then a short while later. Fix this double free by removing
the 2nd kfree.
Detected by CoverityScan, CID#1399524 ("Double Free")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
index 3fd951c..dcfb7df 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
@@ -83,7 +83,6 @@ int amdgpu_map_static_csa(struct amdgpu_device *adev, struct amdgpu_vm *vm)
DRM_ERROR("failed to do bo_map on static CSA, err=%d\n", r);
amdgpu_vm_bo_rmv(adev, bo_va);
ttm_eu_backoff_reservation(&ticket, &list);
- kfree(bo_va);
return r;
}
--
2.10.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 7+ messages in thread
* 答复: [PATCH] drm/amdgpu/virt: fix double kfree on bo_va
[not found] ` <20170203202342.13128-1-colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
@ 2017-02-04 7:07 ` Liu, Monk
0 siblings, 0 replies; 7+ messages in thread
From: Liu, Monk @ 2017-02-04 7:07 UTC (permalink / raw)
To: Colin King, Deucher, Alexander, Koenig, Christian, David Airlie,
Yu, Xiangliang, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1.1: Type: text/plain, Size: 1467 bytes --]
thanks for this catch!
Reviewed-by: Monk Liu <monk.liu@amd.com>
________________________________
发件人: Colin King <colin.king@canonical.com>
发送时间: 2017年2月4日 4:23:42
收件人: Deucher, Alexander; Koenig, Christian; David Airlie; Liu, Monk; Yu, Xiangliang; amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org
抄送: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
主题: [PATCH] drm/amdgpu/virt: fix double kfree on bo_va
From: Colin Ian King <colin.king@canonical.com>
bo_va is being kfree'd twice, once in the call to amdgpu_vm_bo_rmv
and then a short while later. Fix this double free by removing
the 2nd kfree.
Detected by CoverityScan, CID#1399524 ("Double Free")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
index 3fd951c..dcfb7df 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
@@ -83,7 +83,6 @@ int amdgpu_map_static_csa(struct amdgpu_device *adev, struct amdgpu_vm *vm)
DRM_ERROR("failed to do bo_map on static CSA, err=%d\n", r);
amdgpu_vm_bo_rmv(adev, bo_va);
ttm_eu_backoff_reservation(&ticket, &list);
- kfree(bo_va);
return r;
}
--
2.10.2
[-- Attachment #1.2: Type: text/html, Size: 3226 bytes --]
[-- Attachment #2: Type: text/plain, Size: 154 bytes --]
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/amdgpu/virt: fix double kfree on bo_va
2017-02-03 20:23 ` Colin King
(?)
@ 2017-02-09 2:07 ` Alex Deucher
-1 siblings, 0 replies; 7+ messages in thread
From: Alex Deucher @ 2017-02-09 2:07 UTC (permalink / raw)
To: Colin King
Cc: Alex Deucher, Christian König, David Airlie, Monk Liu,
Xiangliang Yu, amd-gfx list, Maling list - DRI developers,
kernel-janitors, LKML
On Fri, Feb 3, 2017 at 3:23 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> bo_va is being kfree'd twice, once in the call to amdgpu_vm_bo_rmv
> and then a short while later. Fix this double free by removing
> the 2nd kfree.
>
> Detected by CoverityScan, CID#1399524 ("Double Free")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied. thanks!
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> index 3fd951c..dcfb7df 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> @@ -83,7 +83,6 @@ int amdgpu_map_static_csa(struct amdgpu_device *adev, struct amdgpu_vm *vm)
> DRM_ERROR("failed to do bo_map on static CSA, err=%d\n", r);
> amdgpu_vm_bo_rmv(adev, bo_va);
> ttm_eu_backoff_reservation(&ticket, &list);
> - kfree(bo_va);
> return r;
> }
>
> --
> 2.10.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/amdgpu/virt: fix double kfree on bo_va
@ 2017-02-09 2:07 ` Alex Deucher
0 siblings, 0 replies; 7+ messages in thread
From: Alex Deucher @ 2017-02-09 2:07 UTC (permalink / raw)
To: Colin King
Cc: kernel-janitors, LKML, amd-gfx list, Xiangliang Yu,
Maling list - DRI developers, Alex Deucher, Christian König,
Monk Liu
On Fri, Feb 3, 2017 at 3:23 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> bo_va is being kfree'd twice, once in the call to amdgpu_vm_bo_rmv
> and then a short while later. Fix this double free by removing
> the 2nd kfree.
>
> Detected by CoverityScan, CID#1399524 ("Double Free")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied. thanks!
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> index 3fd951c..dcfb7df 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> @@ -83,7 +83,6 @@ int amdgpu_map_static_csa(struct amdgpu_device *adev, struct amdgpu_vm *vm)
> DRM_ERROR("failed to do bo_map on static CSA, err=%d\n", r);
> amdgpu_vm_bo_rmv(adev, bo_va);
> ttm_eu_backoff_reservation(&ticket, &list);
> - kfree(bo_va);
> return r;
> }
>
> --
> 2.10.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/amdgpu/virt: fix double kfree on bo_va
@ 2017-02-09 2:07 ` Alex Deucher
0 siblings, 0 replies; 7+ messages in thread
From: Alex Deucher @ 2017-02-09 2:07 UTC (permalink / raw)
To: Colin King
Cc: kernel-janitors, LKML, amd-gfx list, Xiangliang Yu,
Maling list - DRI developers, Alex Deucher, Christian König,
Monk Liu
On Fri, Feb 3, 2017 at 3:23 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> bo_va is being kfree'd twice, once in the call to amdgpu_vm_bo_rmv
> and then a short while later. Fix this double free by removing
> the 2nd kfree.
>
> Detected by CoverityScan, CID#1399524 ("Double Free")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied. thanks!
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> index 3fd951c..dcfb7df 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> @@ -83,7 +83,6 @@ int amdgpu_map_static_csa(struct amdgpu_device *adev, struct amdgpu_vm *vm)
> DRM_ERROR("failed to do bo_map on static CSA, err=%d\n", r);
> amdgpu_vm_bo_rmv(adev, bo_va);
> ttm_eu_backoff_reservation(&ticket, &list);
> - kfree(bo_va);
> return r;
> }
>
> --
> 2.10.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-02-09 2:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-03 20:23 [PATCH] drm/amdgpu/virt: fix double kfree on bo_va Colin King
2017-02-03 20:23 ` Colin King
2017-02-03 20:23 ` Colin King
[not found] ` <20170203202342.13128-1-colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2017-02-04 7:07 ` 答复: " Liu, Monk
2017-02-09 2:07 ` Alex Deucher
2017-02-09 2:07 ` Alex Deucher
2017-02-09 2:07 ` Alex Deucher
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.