Skip to contentSkip to conversation

security: fix error return path in ima_inode_alloc

PATCH In review Xiaotian Feng 2 participants 2 messages Feb 24, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 security: fix error return path in ima_inode_alloc

If radix_tree_preload is failed in ima_inode_alloc, we don't need radix_tree_preload_end because kernel is alread preempt enabled

Cc Mimi Zohar <[email protected]>
Cc James Morris <[email protected]>
Cc Eric Paris <[email protected]>
Cc Al Viro <[email protected]>
Cc Amit K. Arora <[email protected]>
---
 security/integrity/ima/ima_iint.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
security/integrity/ima/ima_iint.c +1 -2
index 0d83edc..2d4d05d 100644
@@ -63,12 +63,11 @@ int ima_inode_alloc(struct inode *inode)
 	spin_lock(&ima_iint_lock);
 	rc = radix_tree_insert(&ima_iint_store, (unsigned long)inode, iint);
 	spin_unlock(&ima_iint_lock);
+	radix_tree_preload_end();
 out:
 	if (rc < 0)
 		kmem_cache_free(iint_cache, iint);
 
-	radix_tree_preload_end();
-
 	return rc;
 }
 
Signature · 1 line
1.6.6
#1 lore raw
Quoted 4 lines · Xiaotian Feng

If radix_tree_preload is failed in ima_inode_alloc, we don't need radix_tree_preload_end because kernel is alread preempt enabled

thanks,
Mimi

Quoted 27 lines
Cc Mimi Zohar <[email protected]>
Cc James Morris <[email protected]>
Cc Eric Paris <[email protected]>
Cc Al Viro <[email protected]>
Cc Amit K. Arora <[email protected]>
---
 security/integrity/ima/ima_iint.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
security/integrity/ima/ima_iint.c +1 -2
index 0d83edc..2d4d05d 100644
@@ -63,12 +63,11 @@ int ima_inode_alloc(struct inode *inode)
 	spin_lock(&ima_iint_lock);
 	rc = radix_tree_insert(&ima_iint_store, (unsigned long)inode, iint);
 	spin_unlock(&ima_iint_lock);
+	radix_tree_preload_end();
 out:
 	if (rc < 0)
 		kmem_cache_free(iint_cache, iint);
 
-	radix_tree_preload_end();
-
 	return rc;
 }