diff options
author | Marcin Slusarz <marcin.slusarz@gmail.com> | 2012-12-10 21:57:20 +0100 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-01-13 17:44:22 +1000 |
commit | c310697b249a2120ce515ec06c83307dd5ff471e (patch) | |
tree | 8adec1241ad65ee2726aebd8d406f6a07ddfbfd0 /nvkm/core | |
parent | ced470f9c5d857c95c8b4f55443884ab3c1b4279 (diff) | |
download | nouveau-c310697b249a2120ce515ec06c83307dd5ff471e.tar.gz |
don't return freed object from nouveau_handle_create
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'nvkm/core')
-rw-r--r-- | nvkm/core/handle.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/nvkm/core/handle.c b/nvkm/core/handle.c index b8d2cbf8a..264c2b338 100644 --- a/nvkm/core/handle.c +++ b/nvkm/core/handle.c @@ -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; @@ -146,6 +146,9 @@ nouveau_handle_create(struct nouveau_object *parent, u32 _parent, u32 _handle, } hprintk(handle, TRACE, "created\n"); + + *phandle = handle; + return 0; } |