mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
libceph: convert ceph_pagelist.refcnt from atomic_t to refcount_t
refcount_t type and corresponding API should be used instead of atomic_t when the variable is used as a reference counter. This allows to avoid accidental refcounter overflows that might lead to use-after-free situations. Signed-off-by: Elena Reshetova <[email protected]> Signed-off-by: Hans Liljestrand <[email protected]> Signed-off-by: Kees Cook <[email protected]> Signed-off-by: David Windsor <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
This commit is contained in:
parent
02113a0f14
commit
0e1a5ee657
3 changed files with 5 additions and 5 deletions
|
|
@ -16,7 +16,7 @@ static void ceph_pagelist_unmap_tail(struct ceph_pagelist *pl)
|
|||
|
||||
void ceph_pagelist_release(struct ceph_pagelist *pl)
|
||||
{
|
||||
if (!atomic_dec_and_test(&pl->refcnt))
|
||||
if (!refcount_dec_and_test(&pl->refcnt))
|
||||
return;
|
||||
ceph_pagelist_unmap_tail(pl);
|
||||
while (!list_empty(&pl->head)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue