@@ -317,7 +317,7 @@ static int read_name_gen = 1;
317317static struct file * __nfs42_ssc_open (struct vfsmount * ss_mnt ,
318318 struct nfs_fh * src_fh , nfs4_stateid * stateid )
319319{
320- struct nfs_fattr fattr ;
320+ struct nfs_fattr * fattr = nfs_alloc_fattr () ;
321321 struct file * filep , * res ;
322322 struct nfs_server * server ;
323323 struct inode * r_ino = NULL ;
@@ -328,9 +328,10 @@ static struct file *__nfs42_ssc_open(struct vfsmount *ss_mnt,
328328
329329 server = NFS_SERVER (ss_mnt -> mnt_root -> d_inode );
330330
331- nfs_fattr_init (& fattr );
331+ if (!fattr )
332+ return ERR_PTR (- ENOMEM );
332333
333- status = nfs4_proc_getattr (server , src_fh , & fattr , NULL , NULL );
334+ status = nfs4_proc_getattr (server , src_fh , fattr , NULL , NULL );
334335 if (status < 0 ) {
335336 res = ERR_PTR (status );
336337 goto out ;
@@ -343,7 +344,7 @@ static struct file *__nfs42_ssc_open(struct vfsmount *ss_mnt,
343344 goto out ;
344345 snprintf (read_name , len , SSC_READ_NAME_BODY , read_name_gen ++ );
345346
346- r_ino = nfs_fhget (ss_mnt -> mnt_root -> d_inode -> i_sb , src_fh , & fattr ,
347+ r_ino = nfs_fhget (ss_mnt -> mnt_root -> d_inode -> i_sb , src_fh , fattr ,
347348 NULL );
348349 if (IS_ERR (r_ino )) {
349350 res = ERR_CAST (r_ino );
@@ -388,6 +389,7 @@ static struct file *__nfs42_ssc_open(struct vfsmount *ss_mnt,
388389out_free_name :
389390 kfree (read_name );
390391out :
392+ nfs_free_fattr (fattr );
391393 return res ;
392394out_stateowner :
393395 nfs4_put_state_owner (sp );
0 commit comments