summaryrefslogtreecommitdiff
path: root/drivers/gpu/host1x/fence.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/host1x/fence.c')
-rw-r--r--drivers/gpu/host1x/fence.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/host1x/fence.c b/drivers/gpu/host1x/fence.c
index e49083b0b09e..ecab72882192 100644
--- a/drivers/gpu/host1x/fence.c
+++ b/drivers/gpu/host1x/fence.c
@@ -152,8 +152,10 @@ struct dma_fence *host1x_fence_create(struct host1x_syncpt *sp, u32 threshold)
return ERR_PTR(-ENOMEM);
fence->waiter = kzalloc(sizeof(*fence->waiter), GFP_KERNEL);
- if (!fence->waiter)
+ if (!fence->waiter) {
+ kfree(fence);
return ERR_PTR(-ENOMEM);
+ }
fence->sp = sp;
fence->threshold = threshold;