[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-id: <1478854301-25466-1-git-send-email-shailendra.v@samsung.com>
Date: Fri, 11 Nov 2016 14:21:41 +0530
From: Shailendra Verma <shailendra.v@...sung.com>
To: Mauro Carvalho Chehab <mchehab@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-media@...r.kernel.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org,
Shailendra Verma <shailendra.v@...sung.com>,
Shailendra Verma <shailendra.capricorn@...il.com>
Cc: vidushi.koul@...sung.com
Subject: [PATCH] Staging: media: davinci_vpfe: - Fix for memory leak if
From: "Shailendra Verma" <shailendra.v@...sung.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@...il.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
Powered by blists - more mailing lists