Messages in this thread Patch in this message | | | From | Peng Hao <> | Subject | [PATCH] security/apparmor/domain: use PTR_ERR_OR_ZERO | Date | Fri, 4 Jan 2019 17:17:10 +0800 |
| |
The variable 'new' may be NULL, so use PTR_ERR_OR_ZERO instead of PTR_ERR.
Signed-off-by: Peng Hao <peng.hao2@zte.com.cn> --- security/apparmor/domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c index 08c88de..7663589 100644 --- a/security/apparmor/domain.c +++ b/security/apparmor/domain.c @@ -1444,7 +1444,7 @@ int aa_change_profile(const char *fqname, int flags) new = aa_label_merge(label, target, GFP_KERNEL); if (IS_ERR_OR_NULL(new)) { info = "failed to build target label"; - error = PTR_ERR(new); + error = PTR_ERR_OR_ZERO(new); new = NULL; perms.allow = 0; goto audit; -- 1.8.3.1
| |