Merge tag 'v3.10.106' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / fs / jfs / xattr.c
index c79b1d7a53e24be8c918313318b325b949997954..537525a7f996047d9472f5f0ed76bc1ffa34a864 100644 (file)
@@ -693,9 +693,10 @@ static int can_set_system_xattr(struct inode *inode, const char *name,
                        return rc;
                }
                if (acl) {
+                       struct posix_acl *old_acl = acl;
                        rc = posix_acl_update_mode(inode, &inode->i_mode, &acl);
-                       posix_acl_release(acl);
-                       if (rc) {
+                       posix_acl_release(old_acl);
+                       if (rc < 0) {
                                printk(KERN_ERR
                                       "posix_acl_update_mode returned %d\n",
                                       rc);