projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9208c05
)
apparmor: Use IS_ERR_OR_NULL() helper function
author
Hongbo Li
<lihongbo22@huawei.com>
Wed, 28 Aug 2024 12:26:18 +0000
(20:26 +0800)
committer
John Johansen
<john.johansen@canonical.com>
Wed, 27 Nov 2024 03:21:05 +0000
(19:21 -0800)
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>
security/apparmor/path.c
patch
|
blob
|
history
diff --git
a/security/apparmor/path.c
b/security/apparmor/path.c
index
45ec994
..
d6c74c3
100644
(file)
--- 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;