[media] zoran: Clean up file handle in open() error path
authorSantosh Kumar Singh <kumar.san1093@gmail.com>
Mon, 19 Dec 2016 16:47:44 +0000 (14:47 -0200)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 31 Jan 2017 09:44:51 +0000 (07:44 -0200)
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>
drivers/media/pci/zoran/zoran_driver.c

index 617574c..180f3d7 100644 (file)
@@ -971,6 +971,7 @@ static int zoran_open(struct file *file)
        return 0;
 
 fail_fh:
+       v4l2_fh_exit(&fh->fh);
        kfree(fh);
 fail_unlock:
        mutex_unlock(&zr->lock);