mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-29 09:12:07 +00:00
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>
This commit is contained in:
parent
9208c05f9f
commit
c030937306
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user