drivers/gpu/drm/savage/savage_state.c: add missing kfree
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 17 Mar 2012 17:57:02 +0000 (18:57 +0100)
committerDave Airlie <airlied@redhat.com>
Tue, 20 Mar 2012 08:45:31 +0000 (08:45 +0000)
Most of the error handling code in this function frees the buffers
kcmd_addr, kvb_addr, and kbox_addr allocated at the beginning of this
function.  These two branches are changed to do the same.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/savage/savage_state.c

index 8a3e31599c94b5c6cf88317eb5a001807b2cdb62..031aaaf79ac2da2c2972dfbadade2530877a55cb 100644 (file)
@@ -1057,7 +1057,8 @@ int savage_bci_cmdbuf(struct drm_device *dev, void *data, struct drm_file *file_
                                DRM_ERROR("indexed drawing command extends "
                                          "beyond end of command buffer\n");
                                DMA_FLUSH();
-                               return -EINVAL;
+                               ret = -EINVAL;
+                               goto done;
                        }
                        /* fall through */
                case SAVAGE_CMD_DMA_PRIM:
@@ -1076,7 +1077,7 @@ int savage_bci_cmdbuf(struct drm_device *dev, void *data, struct drm_file *file_
                                      cmdbuf->vb_stride,
                                      cmdbuf->nbox, cmdbuf->box_addr);
                                if (ret != 0)
-                                       return ret;
+                                       goto done;
                                first_draw_cmd = NULL;
                        }
                }