public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: media: davinci_vpfe: - Fix for memory leak if
@ 2016-11-11  8:51 Shailendra Verma
  2016-11-22 21:52 ` Laurent Pinchart
  0 siblings, 1 reply; 2+ messages in thread
From: Shailendra Verma @ 2016-11-11  8:51 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Greg Kroah-Hartman, linux-media, devel,
	linux-kernel, Shailendra Verma, Shailendra Verma
  Cc: vidushi.koul

From: "Shailendra Verma" <shailendra.v@samsung.com>

Fix to avoid possible memory leak if the decoder initialization
got failed.Free the allocated memory for file handle object
before return in case decoder initialization fails.

Signed-off-by: Shailendra Verma <shailendra.capricorn@gmail.com>
---
 drivers/staging/media/davinci_vpfe/vpfe_video.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c b/drivers/staging/media/davinci_vpfe/vpfe_video.c
index 8be9f85..80c2e25 100644
--- a/drivers/staging/media/davinci_vpfe/vpfe_video.c
+++ b/drivers/staging/media/davinci_vpfe/vpfe_video.c
@@ -423,6 +423,7 @@ static int vpfe_open(struct file *file)
 	/* If decoder is not initialized. initialize it */
 	if (!video->initialized && vpfe_update_pipe_state(video)) {
 		mutex_unlock(&video->lock);
+		kfree(handle);
 		return -ENODEV;
 	}
 	/* Increment device users counter */
-- 
1.7.9.5


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

end of thread, other threads:[~2016-11-22 21:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-11  8:51 [PATCH] Staging: media: davinci_vpfe: - Fix for memory leak if Shailendra Verma
2016-11-22 21:52 ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox