mirror of
https://github.com/torvalds/linux.git
synced 2024-12-30 14:52:05 +00:00
ceph: quota: fix null pointer dereference in quota check
This patch fixes a possible null pointer dereference in
check_quota_exceeded, detected by the static checker smatch, with the
following warning:
fs/ceph/quota.c:240 check_quota_exceeded()
error: we previously assumed 'realm' could be null (see line 188)
Fixes: b7a2921765
("ceph: quota: support for ceph.quota.max_files")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
parent
c2c6d3ce0d
commit
71f2cc64d0
@ -237,6 +237,7 @@ static bool check_quota_exceeded(struct inode *inode, enum quota_check_op op,
|
||||
ceph_put_snap_realm(mdsc, realm);
|
||||
realm = next;
|
||||
}
|
||||
if (realm)
|
||||
ceph_put_snap_realm(mdsc, realm);
|
||||
up_read(&mdsc->snap_rwsem);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user