]> nv-tegra.nvidia Code Review - linux-3.10.git/blobdiff - drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
gpu: nvgpu: Fix invalid GPFIFO entries
[linux-3.10.git] / drivers / gpu / nvgpu / gk20a / channel_sync_gk20a.c
index 3a0b9e4a14a7c84995e0f7ab9dc5a6f7e4874486..23a6c1ee6be96cb7dd8e44646fdedb5ed868e012 100644 (file)
@@ -113,6 +113,9 @@ static int gk20a_channel_syncpt_wait_fd(struct gk20a_channel_sync *s, int fd,
        }
 
        num_wait_cmds = nvhost_sync_num_pts(sync_fence);
+       if (num_wait_cmds == 0)
+               return 0;
+
        gk20a_channel_alloc_priv_cmdbuf(c, 4 * num_wait_cmds, &wait_cmd);
        if (wait_cmd == NULL) {
                gk20a_err(dev_from_gk20a(c->g),
@@ -282,7 +285,7 @@ static void gk20a_channel_syncpt_destroy(struct gk20a_channel_sync *s)
        struct gk20a_channel_syncpt *sp =
                container_of(s, struct gk20a_channel_syncpt, ops);
        nvhost_syncpt_set_min_eq_max_ext(sp->host1x_pdev, sp->id);
-       nvhost_free_syncpt(sp->id);
+       nvhost_syncpt_put_ref_ext(sp->id);
        kfree(sp);
 }