patch-2.4.21 linux-2.4.21/drivers/s390/misc/chandev.c

Next file: linux-2.4.21/drivers/s390/net/iucv.c
Previous file: linux-2.4.21/drivers/s390/idals.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/drivers/s390/misc/chandev.c linux-2.4.21/drivers/s390/misc/chandev.c
@@ -2800,6 +2800,7 @@
 	struct stat statbuf;
 	char        *buff;
 	int         curr,left,len,fd;
+	mm_segment_t oldfs;
 
 	/* if called from chandev_register_and_probe & 
 	   the driver is compiled into the kernel the
@@ -2810,6 +2811,7 @@
 	if(in_interrupt()||current->fs->root==NULL)
 		return;
 	atomic_set(&chandev_conf_read,TRUE);
+	oldfs = get_fs();
 	set_fs(KERNEL_DS);
 	if(stat(CHANDEV_FILE,&statbuf)==0)
 	{
@@ -2834,7 +2836,7 @@
 			vfree(buff);
 		}
 	}
-	set_fs(USER_DS);
+	set_fs(oldfs);
 }
 
 static void chandev_read_conf_if_necessary(void)

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