Skip to content

Commit c030937

Browse files
Hongbo Lijrjohansen
authored andcommitted
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 <[email protected]> Signed-off-by: John Johansen <[email protected]>
1 parent 9208c05 commit c030937

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

security/apparmor/path.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static int d_namespace_path(const struct path *path, char *buf, char **name,
130130
/* handle error conditions - and still allow a partial path to
131131
* be returned.
132132
*/
133-
if (!res || IS_ERR(res)) {
133+
if (IS_ERR_OR_NULL(res)) {
134134
if (PTR_ERR(res) == -ENAMETOOLONG) {
135135
error = -ENAMETOOLONG;
136136
*name = buf;

0 commit comments

Comments
 (0)