Skip to content

Commit

Permalink
drm/nouveau: don't return freed object from nouveau_handle_create
Browse files Browse the repository at this point in the history
Signed-off-by: Marcin Slusarz <[email protected]>
Signed-off-by: Ben Skeggs <[email protected]>
  • Loading branch information
mslusarz authored and Ben Skeggs committed Jan 13, 2013
1 parent cfd376b commit 82c805a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/gpu/drm/nouveau/core/core/handle.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ nouveau_handle_create(struct nouveau_object *parent, u32 _parent, u32 _handle,
while (!nv_iclass(namedb, NV_NAMEDB_CLASS))
namedb = namedb->parent;

handle = *phandle = kzalloc(sizeof(*handle), GFP_KERNEL);
handle = kzalloc(sizeof(*handle), GFP_KERNEL);
if (!handle)
return -ENOMEM;

Expand Down Expand Up @@ -146,6 +146,9 @@ nouveau_handle_create(struct nouveau_object *parent, u32 _parent, u32 _handle,
}

hprintk(handle, TRACE, "created\n");

*phandle = handle;

return 0;
}

Expand Down

0 comments on commit 82c805a

Please sign in to comment.