mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 01:32:21 +02:00
apparmor: Fix return in ns_mkdir_op
Return NULL instead of passing to ERR_PTR while error is zero.
Fixes smatch warning:
- security/apparmor/apparmorfs.c:1846 ns_mkdir_op() warn:
passing zero to 'ERR_PTR'
Fixes: 88d5baf690 ("Change inode_operations.mkdir to return struct dentry *")
Reviewed-by: Ryan Lee <ryan.lee@canonical.com>
Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
59fe6fbc4c
commit
b7a2b49bba
|
|
@ -1975,7 +1975,7 @@ static struct dentry *ns_mkdir_op(struct mnt_idmap *idmap, struct inode *dir,
|
|||
mutex_unlock(&parent->lock);
|
||||
aa_put_ns(parent);
|
||||
|
||||
return ERR_PTR(error);
|
||||
return error ? ERR_PTR(error) : NULL;
|
||||
}
|
||||
|
||||
static int ns_rmdir_op(struct inode *dir, struct dentry *dentry)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user