ceph: quota: fix null pointer dereference in quota check
authorLuis Henriques <lhenriques@suse.com>
Mon, 5 Nov 2018 19:00:52 +0000 (19:00 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Nov 2018 15:13:05 +0000 (16:13 +0100)
commit956d9dd3a7eb3fdf19e068150e675af5afff5b7b
tree61fea8f2ed5c8c30c9d54bd753e3a120d754d8a4
parent990746203150ef965ecb649c9206bf023c63f781
ceph: quota: fix null pointer dereference in quota check

[ Upstream commit 71f2cc64d027d712f29bf8d09d3e123302d5f245 ]

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: b7a2921765cf ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ceph/quota.c