nfsd: clean up unnecessary temporary variable in nfsd4_decode_fattr
Subsystems (2)
PATCH 1/1 nfsd: clean up unnecessary temporary variable in nfsd4_decode_fattr
host_err was only used for nfs4_acl_new.
This patch delete it, and return nfserr_jukebox directly.
Signed-off-by Kinglong Mee <[email protected]>
--- fs/nfsd/nfs4xdr.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
fs/nfsd/nfs4xdr.c +3 -9
@@ -252,7 +252,6 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,int expected_len, len =0 ;u32 dummy32;char *buf; -int host_err;DECODE_HEAD ; iattr->ia_valid =0 ;
@@ -279,10 +278,9 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,return nfserr_resource; *acl =nfs4_acl_new (nace); -if (*acl ==NULL ) { - host_err = -ENOMEM ; - goto out_nfserr; - } +if (*acl ==NULL ) +return nfserr_jukebox; +defer_free (argp, kfree, *acl); (*acl)->naces = nace;
@@ -420,10 +418,6 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, goto xdr_error;DECODE_TAIL ; - -out_nfserr: - status =nfserrno (host_err); - goto out; } static __be32
Signature · 1 line
1.8.4.2
Thanks, applying.--b.
Quoted 47 lines · Kinglong Mee
host_errwas only used fornfs4_acl_new.
This patch delete it, and returnnfserr_jukeboxdirectly.Signed-off-by Kinglong Mee <[email protected]>--- fs/nfsd/nfs4xdr.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)fs/nfsd/nfs4xdr.c +3
-9@@ -252,7 +252,6 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,int expected_len, len =0 ;u32 dummy32;char *buf; -int host_err;DECODE_HEAD ; iattr->ia_valid =0 ;@@ -279,10 +278,9 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,return nfserr_resource; *acl =nfs4_acl_new (nace); -if (*acl ==NULL ) { - host_err = -ENOMEM ; - goto out_nfserr; - } +if (*acl ==NULL ) +return nfserr_jukebox; +defer_free (argp, kfree, *acl); (*acl)->naces = nace;@@ -420,10 +418,6 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, goto xdr_error;DECODE_TAIL ; - -out_nfserr: - status =nfserrno (host_err); - goto out; } static __be32Signature · 1 line
1.8.4.2