mmc: dw_mmc: Make sure we don't get stuck when we get an error
[firefly-linux-kernel-4.4.55.git] / fs / nfsd / nfs2acl.c
index 12b023a7ab7d5292e5bf2b89a82881754058fd36..ac54ea60b3f690c1803a3abd91b38d1250a06f54 100644 (file)
@@ -54,14 +54,14 @@ static __be32 nfsacld_proc_getacl(struct svc_rqst * rqstp,
 
        if (resp->mask & (NFS_ACL|NFS_ACLCNT)) {
                acl = get_acl(inode, ACL_TYPE_ACCESS);
-               if (IS_ERR(acl)) {
-                       nfserr = nfserrno(PTR_ERR(acl));
-                       goto fail;
-               }
                if (acl == NULL) {
                        /* Solaris returns the inode's minimum ACL. */
                        acl = posix_acl_from_mode(inode->i_mode, GFP_KERNEL);
                }
+               if (IS_ERR(acl)) {
+                       nfserr = nfserrno(PTR_ERR(acl));
+                       goto fail;
+               }
                resp->acl_access = acl;
        }
        if (resp->mask & (NFS_DFACL|NFS_DFACLCNT)) {