linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: venus: vdec: fixed possible memory leak issue
@ 2021-12-04 12:11 Ameer Hamza
  2021-12-04 20:29 ` Kieran Bingham
  0 siblings, 1 reply; 7+ messages in thread
From: Ameer Hamza @ 2021-12-04 12:11 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab
  Cc: linux-media, linux-arm-msm, linux-kernel, amhamza.mgc

Fixed coverity warning by freeing the allocated memory before return

Addresses-Coverity: 1494120 ("Resource leak")

Signed-off-by: Ameer Hamza <amhamza.mgc@gmail.com>
---
 drivers/media/platform/qcom/venus/helpers.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
index 84c3a511ec31..344a42853898 100644
--- a/drivers/media/platform/qcom/venus/helpers.c
+++ b/drivers/media/platform/qcom/venus/helpers.c
@@ -197,6 +197,7 @@ int venus_helper_alloc_dpb_bufs(struct venus_inst *inst)
 
 		id = ida_alloc_min(&inst->dpb_ids, VB2_MAX_FRAME, GFP_KERNEL);
 		if (id < 0) {
+			kfree(buf);
 			ret = id;
 			goto fail;
 		}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-12-06 11:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-04 12:11 [PATCH] media: venus: vdec: fixed possible memory leak issue Ameer Hamza
2021-12-04 20:29 ` Kieran Bingham
2021-12-04 20:55   ` [PATCH v2] " Ameer Hamza
2021-12-06  9:55     ` Kieran Bingham
2021-12-06 10:11       ` Kieran Bingham
2021-12-06 10:43         ` [PATCH v3] " Ameer Hamza
2021-12-06 11:32           ` Kieran Bingham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).