diff mbox series

[v11,15/19] media: venus: vdec: fix compile error in vdec_close

Message ID 1497544320-2269-16-git-send-email-stanimir.varbanov@linaro.org
State Accepted
Commit 17571ed6e238ef1353595a87b40414d12b0e0275
Headers show
Series None | expand

Commit Message

Stanimir Varbanov June 15, 2017, 4:31 p.m. UTC
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>

---
 drivers/media/platform/qcom/venus/vdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

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;
 }