From 3e1fbd12c958591695f89b11f9c6ec08d002e358 Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Fri, 22 Dec 2006 01:10:02 -0800 Subject: [PATCH] [PATCH] audit: fix kstrdup() error check kstrdup() returns NULL on error. Cc: David Woodhouse Signed-off-by: Akinobu Mita Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/auditfilter.c | 4 ++-- 1 file 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 */ -- 2.30.2