From: Akinobu Mita Date: Fri, 22 Dec 2006 09:10:02 +0000 (-0800) Subject: [PATCH] audit: fix kstrdup() error check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3e1fbd12c958591695f89b11f9c6ec08d002e358;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [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 --- 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 */