summaryrefslogtreecommitdiff
path: root/drivers/media/platform/qcom
diff options
context:
space:
mode:
authorStanimir Varbanov <stanimir.varbanov@linaro.org>2017-06-15 19:31:56 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-06-20 14:53:41 +0300
commit17571ed6e238ef1353595a87b40414d12b0e0275 (patch)
treebeac9ed3f99e74bf2b0c2d4a8b70b1e0b2ad0daf /drivers/media/platform/qcom
parent832d467115787472140fb254f24f17398aed8d39 (diff)
downloadlinux-17571ed6e238ef1353595a87b40414d12b0e0275.tar.xz
[media] media: venus: vdec: fix compile error in vdec_close
This fixes the following compile error ocured when building with gcc7: drivers/media/platform/qcom/venus/vdec.c:1022 vdec_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>
Diffstat (limited to 'drivers/media/platform/qcom')
-rw-r--r--drivers/media/platform/qcom/venus/vdec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 96e7e7e71e5f..594315b55b1f 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -1017,9 +1017,10 @@ static int vdec_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_dec);
+
+ kfree(inst);
return 0;
}