drm/exynos/ipp: stop hardware before freeing memory
authorAndrzej Hajda <a.hajda@samsung.com>
Thu, 28 Aug 2014 09:07:34 +0000 (11:07 +0200)
committerInki Dae <daeinki@gmail.com>
Fri, 19 Sep 2014 15:56:12 +0000 (00:56 +0900)
Memory shouldn't be freed when hardware is still running.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_ipp.c

index fff3509f7b97a41de1cb2812c03a1c22b08d4ab5..341db52e3939916cd574897360bd4cb9d366f268 100644 (file)
@@ -1282,12 +1282,15 @@ static int ipp_stop_property(struct drm_device *drm_dev,
                struct drm_exynos_ipp_cmd_node *c_node)
 {
        struct drm_exynos_ipp_property *property = &c_node->property;
-       int ret = 0, i;
+       int i;
 
        DRM_DEBUG_KMS("prop_id[%d]\n", property->prop_id);
 
        /* put event */
        ipp_put_event(c_node, NULL);
+       /* stop operations */
+       if (ippdrv->stop)
+               ippdrv->stop(ippdrv->dev, property->cmd);
 
        /* check command */
        switch (property->cmd) {
@@ -1303,16 +1306,10 @@ static int ipp_stop_property(struct drm_device *drm_dev,
                break;
        default:
                DRM_ERROR("invalid operations.\n");
-               ret = -EINVAL;
-               goto err_clear;
+               return -EINVAL;
        }
 
-err_clear:
-       /* stop operations */
-       if (ippdrv->stop)
-               ippdrv->stop(ippdrv->dev, property->cmd);
-
-       return ret;
+       return 0;
 }
 
 void ipp_sched_cmd(struct work_struct *work)