summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2012-12-10 21:57:20 +0100
committerBen Skeggs <bskeggs@redhat.com>2013-01-13 18:07:41 +1000
commit82c805abb20946dcb343cd607327e4d720bf6b28 (patch)
tree8e84e38cd663d060af04e60b64df6888b0688778 /drivers
parentcfd376b6bfccf33782a0748a9c70f7f752f8b869 (diff)
downloadlinux-exynos-82c805abb20946dcb343cd607327e4d720bf6b28.tar.gz
linux-exynos-82c805abb20946dcb343cd607327e4d720bf6b28.tar.bz2
linux-exynos-82c805abb20946dcb343cd607327e4d720bf6b28.zip
drm/nouveau: 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 'drivers')
-rw-r--r--drivers/gpu/drm/nouveau/core/core/handle.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/core/core/handle.c b/drivers/gpu/drm/nouveau/core/core/handle.c
index b8d2cbf8a7a7..264c2b338ac3 100644
--- a/drivers/gpu/drm/nouveau/core/core/handle.c
+++ b/drivers/gpu/drm/nouveau/core/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;
}