Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1666864 > unrolled thread

[PATCH v11 16/19] media: venus: venc: fix compile error in venc_close

Started byStanimir Varbanov <stanimir.varbanov@linaro.org>
First post2017-06-15 18:40 +0200
Last post2017-06-15 18:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v11 16/19] media: venus: venc: fix compile error in venc_close Stanimir Varbanov <stanimir.varbanov@linaro.org> - 2017-06-15 18:40 +0200

#1666864 — [PATCH v11 16/19] media: venus: venc: fix compile error in venc_close

FromStanimir Varbanov <stanimir.varbanov@linaro.org>
Date2017-06-15 18:40 +0200
Subject[PATCH v11 16/19] media: venus: venc: fix compile error in venc_close
Message-ID<tSFYm-4Nd-27@gated-at.bofh.it>
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>
---
 drivers/media/platform/qcom/venus/venc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web