Skip to content

Commit

Permalink
[PATCH] audit: fix kstrdup() error check
Browse files Browse the repository at this point in the history
kstrdup() returns NULL on error.

Cc: David Woodhouse <[email protected]>
Signed-off-by: Akinobu Mita <[email protected]>
Cc: Al Viro <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
mita authored and Linus Torvalds committed Dec 22, 2006
1 parent 5c95da9 commit 3e1fbd1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/auditfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 3e1fbd1

Please sign in to comment.