patch-2.4.3 linux/drivers/media/video/videodev.c

Next file: linux/drivers/media/video/vino.c
Previous file: linux/drivers/media/video/stradis.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.2/linux/drivers/media/video/videodev.c linux/drivers/media/video/videodev.c
@@ -166,6 +166,9 @@
 		goto error_out;
 	}
 	vfl->busy=1;		/* In case vfl->open sleeps */
+	
+	if(vfl->owner)
+		__MOD_INC_USE_COUNT(vfl->owner);
 	unlock_kernel();
 	
 	if(vfl->open)
@@ -174,6 +177,9 @@
 		if(err)
 		{
 			vfl->busy=0;
+			if(vfl->owner)
+				__MOD_DEC_USE_COUNT(vfl->owner);
+			
 			return err;
 		}
 	}
@@ -195,6 +201,8 @@
 	if(vfl->close)
 		vfl->close(vfl);
 	vfl->busy=0;
+	if(vfl->owner)
+		__MOD_DEC_USE_COUNT(vfl->owner);
 	unlock_kernel();
 	return 0;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)