diff options
| author | Xiubo Li <xiubo.li@clyso.com> | 2026-07-14 14:20:37 +0800 |
|---|---|---|
| committer | Ilya Dryomov <idryomov@gmail.com> | 2026-08-26 19:57:27 +0200 |
| commit | a354d7eaa1a57f1532c8072a424cc2d339a73cc0 (patch) | |
| tree | 87c0cbca244bc5b466357aa7ce3d1ac861979bcb /scripts/const_structs.checkpatch | |
| parent | af59562a5b3d34fb3aa7753f2543393578d06dbf (diff) | |
| download | linux-a354d7eaa1a57f1532c8072a424cc2d339a73cc0.tar.gz linux-a354d7eaa1a57f1532c8072a424cc2d339a73cc0.zip | |
ceph: fix use-after-dereference of NULL ci in __ceph_remove_cap()
The NULL check for "ci" in __ceph_remove_cap() was dead code because
ci was dereferenced via &ci->netfs.inode before the check, and
cap->session was dereferenced via session->s_mdsc->fsc->client even
earlier. On a double-remove, both cap->ci and cap->session are set
to NULL by the first call, so the second call would crash before
ever reaching the guard.
Move ci, session, cl, and inode initializations after the NULL check
so that the early-return actually works.
Signed-off-by: Xiubo Li <xiubo.li@clyso.com>
Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'scripts/const_structs.checkpatch')
0 files changed, 0 insertions, 0 deletions
