freedreno/drm-shim: fix mem leak
authorEric Engestrom <eric.engestrom@intel.com>
Mon, 26 Aug 2019 14:42:32 +0000 (15:42 +0100)
committerEric Engestrom <eric.engestrom@intel.com>
Tue, 3 Sep 2019 23:18:37 +0000 (00:18 +0100)
Fixes: 494ecef6b42198ab6c3e ("freedreno: Add support for drm-shim.")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/freedreno/drm-shim/freedreno_noop.c

index 66bb53dc5d3bac5e09c851b086902a9e39611d93..6a3fbb7b67f3f8932c11f4f7874d6b45e9876cdc 100644 (file)
@@ -84,14 +84,15 @@ msm_ioctl_gem_info(int fd, unsigned long request, void *arg)
        switch (args->info) {
        case MSM_INFO_GET_OFFSET:
                args->value = drm_shim_bo_get_mmap_offset(shim_fd, bo);
-               return 0;
+               break;
        case MSM_INFO_GET_IOVA:
                args->value = msm_bo(bo)->offset;
-               return 0;
+               break;
        case MSM_INFO_SET_NAME:
-               return 0;
+               break;
        default:
                fprintf(stderr, "Unknown DRM_IOCTL_MSM_GEM_INFO %d\n", args->info);
+               drm_shim_bo_put(bo);
                return -1;
        }