From: Hongbo Li Date: Wed, 28 Aug 2024 12:26:18 +0000 (+0800) Subject: apparmor: Use IS_ERR_OR_NULL() helper function X-Git-Tag: microblaze-v6.16~497^2~14 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=c03093730616a0ce23b1f25f0c5a7f3f613ca94a;p=linux-2.6-microblaze.git apparmor: Use IS_ERR_OR_NULL() helper function Use the IS_ERR_OR_NULL() helper instead of open-coding a NULL and an error pointer checks to simplify the code and improve readability. Signed-off-by: Hongbo Li Signed-off-by: John Johansen --- diff --git a/security/apparmor/path.c b/security/apparmor/path.c index 45ec994b558d..d6c74c357ffd 100644 --- a/security/apparmor/path.c +++ b/security/apparmor/path.c @@ -130,7 +130,7 @@ static int d_namespace_path(const struct path *path, char *buf, char **name, /* handle error conditions - and still allow a partial path to * be returned. */ - if (!res || IS_ERR(res)) { + if (IS_ERR_OR_NULL(res)) { if (PTR_ERR(res) == -ENAMETOOLONG) { error = -ENAMETOOLONG; *name = buf;