summaryrefslogtreecommitdiff
path: root/drivers/media/usb/tm6000/tm6000-video.c
diff options
context:
space:
mode:
authorSantosh Kumar Singh <kumar.san1093@gmail.com>2016-12-19 15:10:58 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-01-31 07:45:24 -0200
commit1e071039b1535e2a781acc750681deb2eb838565 (patch)
treef4adac273f1110052eabbc39a33ee9875c49093b /drivers/media/usb/tm6000/tm6000-video.c
parent2217a1d1cb0673daa398a08475e6c493b1dc663f (diff)
[media] tm6000: Clean up file handle in open() error path
Fix to avoid possible memory leak and exit file handle in error paths. Signed-off-by: Santosh Kumar Singh <kumar.san1093@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/usb/tm6000/tm6000-video.c')
-rw-r--r--drivers/media/usb/tm6000/tm6000-video.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c
index 3367a3b72530..c4fdc1fa32ef 100644
--- a/drivers/media/usb/tm6000/tm6000-video.c
+++ b/drivers/media/usb/tm6000/tm6000-video.c
@@ -1371,8 +1371,11 @@ static int __tm6000_open(struct file *file)
/* initialize hardware on analog mode */
rc = tm6000_init_analog_mode(dev);
- if (rc < 0)
+ if (rc < 0) {
+ v4l2_fh_exit(&fh->fh);
+ kfree(fh);
return rc;
+ }
dev->mode = TM6000_MODE_ANALOG;