@@ -317,7 +317,7 @@ static int read_name_gen = 1;
317
317
static struct file * __nfs42_ssc_open (struct vfsmount * ss_mnt ,
318
318
struct nfs_fh * src_fh , nfs4_stateid * stateid )
319
319
{
320
- struct nfs_fattr fattr ;
320
+ struct nfs_fattr * fattr = nfs_alloc_fattr () ;
321
321
struct file * filep , * res ;
322
322
struct nfs_server * server ;
323
323
struct inode * r_ino = NULL ;
@@ -328,9 +328,10 @@ static struct file *__nfs42_ssc_open(struct vfsmount *ss_mnt,
328
328
329
329
server = NFS_SERVER (ss_mnt -> mnt_root -> d_inode );
330
330
331
- nfs_fattr_init (& fattr );
331
+ if (!fattr )
332
+ return ERR_PTR (- ENOMEM );
332
333
333
- status = nfs4_proc_getattr (server , src_fh , & fattr , NULL , NULL );
334
+ status = nfs4_proc_getattr (server , src_fh , fattr , NULL , NULL );
334
335
if (status < 0 ) {
335
336
res = ERR_PTR (status );
336
337
goto out ;
@@ -343,7 +344,7 @@ static struct file *__nfs42_ssc_open(struct vfsmount *ss_mnt,
343
344
goto out ;
344
345
snprintf (read_name , len , SSC_READ_NAME_BODY , read_name_gen ++ );
345
346
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 ,
347
348
NULL );
348
349
if (IS_ERR (r_ino )) {
349
350
res = ERR_CAST (r_ino );
@@ -388,6 +389,7 @@ static struct file *__nfs42_ssc_open(struct vfsmount *ss_mnt,
388
389
out_free_name :
389
390
kfree (read_name );
390
391
out :
392
+ nfs_free_fattr (fattr );
391
393
return res ;
392
394
out_stateowner :
393
395
nfs4_put_state_owner (sp );
0 commit comments