diff options
author | Hongbo Li <lihongbo22@huawei.com> | 2024-08-28 14:26:18 +0200 |
---|---|---|
committer | John Johansen <john.johansen@canonical.com> | 2024-11-27 04:21:05 +0100 |
commit | c03093730616a0ce23b1f25f0c5a7f3f613ca94a (patch) | |
tree | 194872ab46a82423d744c5c5a41f899f41739b43 /security/apparmor | |
parent | apparmor: add support for 2^24 states to the dfa state machine. (diff) | |
download | linux-c03093730616a0ce23b1f25f0c5a7f3f613ca94a.tar.xz linux-c03093730616a0ce23b1f25f0c5a7f3f613ca94a.zip |
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 <lihongbo22@huawei.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor')
-rw-r--r-- | security/apparmor/path.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |