Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e1fbd12 authored by Akinobu Mita's avatar Akinobu Mita Committed by Linus Torvalds
Browse files

[PATCH] audit: fix kstrdup() error check



kstrdup() returns NULL on error.

Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5c95da9f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -800,7 +800,7 @@ 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)))
	if (unlikely(!se_str))
		return -ENOMEM;
	df->se_str = se_str;