vmwgfx: memory leaks caused by double allocation
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 18 Oct 2011 06:09:45 +0000 (09:09 +0300)
committerDave Airlie <airlied@redhat.com>
Tue, 18 Oct 2011 09:41:31 +0000 (10:41 +0100)
These variables get allocated twice so the first allocation is a
memory leak.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c

index 35d5f61fc7e42702b329bfd8e0e61fd85c88ec2e..15fb26088d68e745a20065ec6bf4101b04d7279b 100644 (file)
@@ -953,8 +953,7 @@ int vmw_event_fence_action_create(struct drm_file *file_priv,
                                  uint32_t *tv_usec,
                                  bool interruptible)
 {
-       struct vmw_event_fence_action *eaction =
-               kzalloc(sizeof(*eaction), GFP_KERNEL);
+       struct vmw_event_fence_action *eaction;
        struct ttm_mem_global *mem_glob =
                vmw_mem_glob(fence->fman->dev_priv);
        struct vmw_fence_manager *fman = fence->fman;
index c7cff3debe1114b6b252fab48728056c1fa7cf86..86c5e4cceb31ef83beb568e3b912de62f73a2648 100644 (file)
@@ -1255,8 +1255,7 @@ int vmw_surface_define_ioctl(struct drm_device *dev, void *data,
                             struct drm_file *file_priv)
 {
        struct vmw_private *dev_priv = vmw_priv(dev);
-       struct vmw_user_surface *user_srf =
-           kmalloc(sizeof(*user_srf), GFP_KERNEL);
+       struct vmw_user_surface *user_srf;
        struct vmw_surface *srf;
        struct vmw_resource *res;
        struct vmw_resource *tmp;