diff options
author | Wenchao Hao <haowenchao2@huawei.com> | 2023-11-23 09:53:40 +0800 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2024-01-15 15:40:51 +0100 |
commit | 0f4cf64eabc6e16cfc2704f1960e82dc79d91c8d (patch) | |
tree | 9544fd3a9f4996f25778a70bc47a2c4c23da4c9a /drivers/cdx/controller/mcdi_functions.c | |
parent | b36b03344f5fccb81e5cf3b3ede68b7e7a7e930a (diff) |
ceph: fix invalid pointer access if get_quota_realm return ERR_PTR
This issue is reported by smatch that get_quota_realm() might return
ERR_PTR but we did not handle it. It's not a immediate bug, while we
still should address it to avoid potential bugs if get_quota_realm()
is changed to return other ERR_PTR in future.
Set ceph_snap_realm's pointer in get_quota_realm()'s to address this
issue, the pointer would be set to NULL if get_quota_realm() failed
to get struct ceph_snap_realm, so no ERR_PTR would happen any more.
[ xiubli: minor code style clean up ]
Signed-off-by: Wenchao Hao <haowenchao2@huawei.com>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'drivers/cdx/controller/mcdi_functions.c')
0 files changed, 0 insertions, 0 deletions