]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - security/selinux/hooks.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[mv-sheeva.git] / security / selinux / hooks.c
index aff8f46c2aa204601b25c2442204aeb20e10c132..6237933f7d82c3454c4409a00a1aa779ef5ceee3 100644 (file)
@@ -2318,7 +2318,7 @@ static int selinux_inode_setxattr(struct dentry *dentry, char *name, void *value
        if (sbsec->behavior == SECURITY_FS_USE_MNTPOINT)
                return -EOPNOTSUPP;
 
-       if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
+       if (!is_owner_or_cap(inode))
                return -EPERM;
 
        AVC_AUDIT_DATA_INIT(&ad,FS);
@@ -4658,8 +4658,7 @@ static int selinux_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
 
 static void selinux_release_secctx(char *secdata, u32 seclen)
 {
-       if (secdata)
-               kfree(secdata);
+       kfree(secdata);
 }
 
 #ifdef CONFIG_KEYS
@@ -4913,7 +4912,7 @@ static __init int selinux_init(void)
 
        sel_inode_cache = kmem_cache_create("selinux_inode_security",
                                            sizeof(struct inode_security_struct),
-                                           0, SLAB_PANIC, NULL, NULL);
+                                           0, SLAB_PANIC, NULL);
        avc_init();
 
        original_ops = secondary_ops = security_ops;