Skip to content

Commit

Permalink
[media] media: venus: venc: fix compile error in venc_close
Browse files Browse the repository at this point in the history
This fixes the following compile error ocured when building
with gcc7:

drivers/media/platform/qcom/venus/venc.c:1150
venc_close() error: dereferencing freed memory 'inst'

by moving kfree as a last call.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
  • Loading branch information
Stanimir Varbanov authored and Mauro Carvalho Chehab committed Jun 20, 2017
1 parent 17571ed commit c3eb9e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/platform/qcom/venus/venc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1145,10 +1145,10 @@ static int venc_close(struct file *file)
mutex_destroy(&inst->lock);
v4l2_fh_del(&inst->fh);
v4l2_fh_exit(&inst->fh);
kfree(inst);

pm_runtime_put_sync(inst->core->dev_enc);

kfree(inst);
return 0;
}

Expand Down

0 comments on commit c3eb9e5

Please sign in to comment.