return(CHOOSE_MODE_PROC(sys_modify_ldt_tt, sys_modify_ldt_skas, func, ptr, bytecount)); 
struct user_desc info; int res = 0; void *buf = NULL; void *p = NULL; /* What we pass to host. */  switch(func){ case 1: case 0x11: /* write_ldt */ /* Do this check now to avoid overflows. */ if (bytecount != sizeof(struct user_desc)) { res = -EINVAL; goto out; }  if(copy_from_user(&info, ptr, sizeof(info))) { res = -EFAULT; goto out; }  p = &info; break; case 0: case 2: /* read_ldt */  /* The use of info avoids kmalloc on the write case, not on the * read one. */ buf = kmalloc(bytecount, GFP_KERNEL); if (!buf) { res = -ENOMEM; goto out; } p = buf; default: res = -ENOSYS; goto out; }  res = CHOOSE_MODE_PROC(do_modify_ldt_tt, do_modify_ldt_skas, func, p, bytecount); if(res < 0) goto out;  switch(func){ case 0: case 2: /* Modify_ldt was for reading and returned the number of read * bytes.*/ if(copy_to_user(ptr, p, res)) res = -EFAULT; break; }  out: kfree(buf); return res; 
int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount){	return(CHOOSE_MODE_PROC(sys_modify_ldt_tt, sys_modify_ldt_skas, func, 				ptr, bytecount));}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/2e5e55923e315e8198f46f24f7ca37e1fd9aa102/ldt.c/buggy/arch/um/sys-i386/ldt.c