diff options
author | Santosh Kumar Singh <kumar.san1093@gmail.com> | 2016-12-19 20:10:58 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-01-31 12:45:24 +0300 |
commit | 1e071039b1535e2a781acc750681deb2eb838565 (patch) | |
tree | f4adac273f1110052eabbc39a33ee9875c49093b /drivers/media/usb/tm6000 | |
parent | 2217a1d1cb0673daa398a08475e6c493b1dc663f (diff) | |
download | linux-1e071039b1535e2a781acc750681deb2eb838565.tar.xz |
[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')
-rw-r--r-- | drivers/media/usb/tm6000/tm6000-video.c | 5 |
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; |