提交 3e1fbd12 编写于 作者: A Akinobu Mita 提交者: Linus Torvalds

[PATCH] audit: fix kstrdup() error check

kstrdup() returns NULL on error.

Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 5c95da9f
......@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册