summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2006-12-22 01:10:02 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-22 08:55:49 -0800
commit3e1fbd12c958591695f89b11f9c6ec08d002e358 (patch)
tree9b830a3a3ada95b25ef0d0c3d6d306eb18dda066
parent5c95da9f5abeff865b7273b59e1a3c50a2c5acb2 (diff)
[PATCH] audit: fix kstrdup() error check
kstrdup() returns NULL on error. Cc: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--kernel/auditfilter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index 2e896f8ae29e..9c8c23227c7f 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -800,8 +800,8 @@ static inline int audit_dupe_selinux_field(struct audit_field *df,
/* our own copy of se_str */
se_str = kstrdup(sf->se_str, GFP_KERNEL);
- if (unlikely(IS_ERR(se_str)))
- return -ENOMEM;
+ if (unlikely(!se_str))
+ return -ENOMEM;
df->se_str = se_str;
/* our own (refreshed) copy of se_rule */