]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[media] pvrusb2: Clean up file handle in open() error path
authorSantosh Kumar Singh <kumar.san1093@gmail.com>
Mon, 19 Dec 2016 17:20:37 +0000 (15:20 -0200)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 31 Jan 2017 09:46:09 +0000 (07:46 -0200)
Fix to avoid possible 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/usb/pvrusb2/pvrusb2-v4l2.c

index 88283d7229f0d80355c2e15606efcfd2e7f311ca..8f13c60198ed64d72dc74ebf56eacb28714aba86 100644 (file)
@@ -1050,7 +1050,7 @@ static int pvr2_v4l2_open(struct file *file)
                pvr2_trace(PVR2_TRACE_STRUCT,
                           "Destroying pvr_v4l2_fh id=%p (input mask error)",
                           fhp);
-
+               v4l2_fh_exit(&fhp->fh);
                kfree(fhp);
                return ret;
        }
@@ -1067,6 +1067,7 @@ static int pvr2_v4l2_open(struct file *file)
                pvr2_trace(PVR2_TRACE_STRUCT,
                           "Destroying pvr_v4l2_fh id=%p (input map failure)",
                           fhp);
+               v4l2_fh_exit(&fhp->fh);
                kfree(fhp);
                return -ENOMEM;
        }