From: Stanimir Varbanov Date: Thu, 15 Jun 2017 16:31:57 +0000 (-0300) Subject: [media] media: venus: venc: fix compile error in venc_close X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c3eb9e51c86bae9c482d28f9a73c06cf2ae6c73b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [media] media: venus: venc: fix compile error in venc_close 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 Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index d5b4b5bf10a2..39748e7a08e4 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -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; }