[media] pvrusb2: Clean up file handle in open() error path

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>
This commit is contained in:
Santosh Kumar Singh 2016-12-19 15:20:37 -02:00 committed by Mauro Carvalho Chehab
parent c5b81fe36c
commit 01faa0d9c7

View 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;
}