Skip to contentSkip to conversation

pvrusb2: Clean up file handle in open() error path.

PATCH New Santosh Kumar Singh 1 participant 1 message Dec 19, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pvrusb2: Clean up file handle in open() error path.

Fix to avoid possible exit file handle in error paths.

---
 drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c +2 -1
index 2cc4d2b..2683373 100644
@@ -1054,7 +1054,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;
 	}
@@ -1071,6 +1071,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;
 	}
Signature · 1 line
1.9.1