Skip to content

Commit

Permalink
apparmor: Use IS_ERR_OR_NULL() helper function
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Hongbo Li authored and John Johansen committed Nov 27, 2024
1 parent 9208c05 commit c030937
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/apparmor/path.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c030937

Please sign in to comment.