]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
drm/vmwgfx: Fix OTABLE takedown
authorThomas Hellstrom <thellstrom@vmware.com>
Thu, 25 Jun 2015 18:12:17 +0000 (11:12 -0700)
committerThomas Hellstrom <thellstrom@vmware.com>
Wed, 5 Aug 2015 12:01:04 +0000 (14:01 +0200)
Don't fence and free the BO if command submission fails.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
drivers/gpu/drm/vmwgfx/vmwgfx_mob.c

index f06d60f41fa7c73b0f02e5cbcaefc5cdb3f95928..46f975e57d06830e1affbb41c745606f15d2dd71 100644 (file)
@@ -191,17 +191,18 @@ static void vmw_takedown_otable_base(struct vmw_private *dev_priv,
        if (unlikely(cmd == NULL)) {
                DRM_ERROR("Failed reserving FIFO space for OTable "
                          "takedown.\n");
-       } else {
-               memset(cmd, 0, sizeof(*cmd));
-               cmd->header.id = SVGA_3D_CMD_SET_OTABLE_BASE;
-               cmd->header.size = sizeof(cmd->body);
-               cmd->body.type = type;
-               cmd->body.baseAddress = 0;
-               cmd->body.sizeInBytes = 0;
-               cmd->body.validSizeInBytes = 0;
-               cmd->body.ptDepth = SVGA3D_MOBFMT_INVALID;
-               vmw_fifo_commit(dev_priv, sizeof(*cmd));
+               return;
        }
+       memset(cmd, 0, sizeof(*cmd));
+       cmd->header.id = SVGA_3D_CMD_SET_OTABLE_BASE;
+       cmd->header.size = sizeof(cmd->body);
+       cmd->body.type = type;
+       cmd->body.baseAddress = 0;
+       cmd->body.sizeInBytes = 0;
+       cmd->body.validSizeInBytes = 0;
+       cmd->body.ptDepth = SVGA3D_MOBFMT_INVALID;
+       vmw_fifo_commit(dev_priv, sizeof(*cmd));
 
        if (bo) {
                int ret;