Skip to contentSkip to conversation

audit: fix kstrdup() error check

PATCH New Akinobu Mita 1 participant 1 message Nov 27, 2006 Audit

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 audit: fix kstrdup() error check

kstrdup() returns NULL on error.

Cc David Woodhouse <[email protected]>
---
 kernel/auditfilter.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/auditfilter.c +2 -2
Index: work-fault-inject/kernel/auditfilter.c
===================================================================
@@ -800,8 +800,8 @@ static inline int audit_dupe_selinux_fie
 
 	/* 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 */