@@ -395,6 +395,7 @@ static int
395395devpts_fill_super (struct super_block * s , void * data , int silent )
396396{
397397 struct inode * inode ;
398+ int error ;
398399
399400 s -> s_iflags &= ~SB_I_NODEV ;
400401 s -> s_blocksize = 1024 ;
@@ -403,10 +404,16 @@ devpts_fill_super(struct super_block *s, void *data, int silent)
403404 s -> s_op = & devpts_sops ;
404405 s -> s_time_gran = 1 ;
405406
407+ error = - ENOMEM ;
406408 s -> s_fs_info = new_pts_fs_info (s );
407409 if (!s -> s_fs_info )
408410 goto fail ;
409411
412+ error = parse_mount_options (data , PARSE_MOUNT , & DEVPTS_SB (s )-> mount_opts );
413+ if (error )
414+ goto fail ;
415+
416+ error = - ENOMEM ;
410417 inode = new_inode (s );
411418 if (!inode )
412419 goto fail ;
@@ -424,7 +431,7 @@ devpts_fill_super(struct super_block *s, void *data, int silent)
424431 pr_err ("get root dentry failed\n" );
425432
426433fail :
427- return - ENOMEM ;
434+ return error ;
428435}
429436
430437/*
@@ -437,13 +444,8 @@ static struct dentry *devpts_mount(struct file_system_type *fs_type,
437444 int flags , const char * dev_name , void * data )
438445{
439446 int error ;
440- struct pts_mount_opts opts ;
441447 struct super_block * s ;
442448
443- error = parse_mount_options (data , PARSE_MOUNT , & opts );
444- if (error )
445- return ERR_PTR (error );
446-
447449 s = sget (fs_type , NULL , set_anon_super , flags , NULL );
448450 if (IS_ERR (s ))
449451 return ERR_CAST (s );
@@ -455,8 +457,6 @@ static struct dentry *devpts_mount(struct file_system_type *fs_type,
455457 s -> s_flags |= MS_ACTIVE ;
456458 }
457459
458- memcpy (& (DEVPTS_SB (s ))-> mount_opts , & opts , sizeof (opts ));
459-
460460 error = mknod_ptmx (s );
461461 if (error )
462462 goto out_undo_sget ;
0 commit comments