diff mbox

drm/nouveau: fix memory leak

Message ID 1441963856-17465-1-git-send-email-sudipm.mukherjee@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sudip Mukherjee Sept. 11, 2015, 9:30 a.m. UTC
If pm_runtime_get_sync() we were going to "out" but we missed freeing
vma.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/gpu/drm/nouveau/nouveau_gem.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Sudip Mukherjee Sept. 24, 2015, 3:59 p.m. UTC | #1
On Fri, Sep 11, 2015 at 03:00:56PM +0530, Sudip Mukherjee wrote:
> If pm_runtime_get_sync() we were going to "out" but we missed freeing
> vma.
> 
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
Hi Ben,
Another gentle ping for another patch.

regards
sudip
Ben Skeggs Oct. 1, 2015, 6:40 a.m. UTC | #2
On 09/25/2015 01:59 AM, Sudip Mukherjee wrote:
> On Fri, Sep 11, 2015 at 03:00:56PM +0530, Sudip Mukherjee wrote:
>> If pm_runtime_get_sync() we were going to "out" but we missed
>> freeing vma.
>> 
>> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> ---
> Hi Ben, Another gentle ping for another patch.
Both patches are in my tree.

Thanks,
Ben.

> 
> regards sudip _______________________________________________ 
> dri-devel mailing list dri-devel@lists.freedesktop.org 
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
Sudip Mukherjee Oct. 1, 2015, 12:53 p.m. UTC | #3
On Thu, Oct 01, 2015 at 04:40:59PM +1000, Ben Skeggs wrote:
> On 09/25/2015 01:59 AM, Sudip Mukherjee wrote:
> > On Fri, Sep 11, 2015 at 03:00:56PM +0530, Sudip Mukherjee wrote:
> >> If pm_runtime_get_sync() we were going to "out" but we missed
> >> freeing vma.
> >> 
> >> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> ---
> > Hi Ben, Another gentle ping for another patch.
> Both patches are in my tree.

Thanks Ben.

regards
sudip
Sudip Mukherjee Oct. 8, 2015, 1 p.m. UTC | #4
On Thu, Oct 01, 2015 at 04:40:59PM +1000, Ben Skeggs wrote:
> On 09/25/2015 01:59 AM, Sudip Mukherjee wrote:
> > On Fri, Sep 11, 2015 at 03:00:56PM +0530, Sudip Mukherjee wrote:
> >> If pm_runtime_get_sync() we were going to "out" but we missed
> >> freeing vma.
> >> 
> >> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> ---
> > Hi Ben, Another gentle ping for another patch.
> Both patches are in my tree.

Hi Ben,
I am not seeing these in linux-next.

regards
sudip
Emil Velikov Oct. 8, 2015, 2:22 p.m. UTC | #5
On 8 October 2015 at 14:00, Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:
> On Thu, Oct 01, 2015 at 04:40:59PM +1000, Ben Skeggs wrote:
>> On 09/25/2015 01:59 AM, Sudip Mukherjee wrote:
>> > On Fri, Sep 11, 2015 at 03:00:56PM +0530, Sudip Mukherjee wrote:
>> >> If pm_runtime_get_sync() we were going to "out" but we missed
>> >> freeing vma.
>> >>
>> >> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> ---
>> > Hi Ben, Another gentle ping for another patch.
>> Both patches are in my tree.
>
> Hi Ben,
> I am not seeing these in linux-next.
>
The nouveau tree does not merge into linux-next I'm afraid. Perhaps we
should as Ben gets the chance/time.

Regards,
Emil
Sudip Mukherjee Oct. 14, 2015, 4:56 a.m. UTC | #6
On Thu, Oct 08, 2015 at 03:22:20PM +0100, Emil Velikov wrote:
> On 8 October 2015 at 14:00, Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:
> > On Thu, Oct 01, 2015 at 04:40:59PM +1000, Ben Skeggs wrote:
> >> On 09/25/2015 01:59 AM, Sudip Mukherjee wrote:
> >> > On Fri, Sep 11, 2015 at 03:00:56PM +0530, Sudip Mukherjee wrote:
> >> >> If pm_runtime_get_sync() we were going to "out" but we missed
> >> >> freeing vma.
> >> >>
> >> >> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> ---
> >> > Hi Ben, Another gentle ping for another patch.
> >> Both patches are in my tree.
> >
> > Hi Ben,
> > I am not seeing these in linux-next.
> >
> The nouveau tree does not merge into linux-next I'm afraid. Perhaps we
> should as Ben gets the chance/time.

Can I be of any help in that? Maybe I can learn few things about drm in
the proces.

regards
sudip
diff mbox

Patch

diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
index 2c99815..c05b2f7 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -84,8 +84,10 @@  nouveau_gem_object_open(struct drm_gem_object *gem, struct drm_file *file_priv)
 		}
 
 		ret = pm_runtime_get_sync(dev);
-		if (ret < 0 && ret != -EACCES)
+		if (ret < 0 && ret != -EACCES) {
+			kfree(vma);
 			goto out;
+		}
 
 		ret = nouveau_bo_vma_add(nvbo, cli->vm, vma);
 		if (ret)