aboutsummaryrefslogtreecommitdiff
path: root/include/linux/refcount.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <[email protected]>2024-08-19 06:24:50 +0200
committerGreg Kroah-Hartman <[email protected]>2024-08-19 06:24:50 +0200
commitebbe30f4bba127505c5664dd67f519e5e06d16be (patch)
tree7285f44ba6e74a25876982cb50f9a430169cc42e /include/linux/refcount.h
parent1241b384efa53f4b7a95fe2b34d69359bb3ae1b5 (diff)
parent47ac09b91befbb6a235ab620c32af719f8208399 (diff)
Merge 6.11-rc4 into tty-next
We need the tty/serial fixes in here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'include/linux/refcount.h')
-rw-r--r--include/linux/refcount.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/refcount.h b/include/linux/refcount.h
index 59b3b752394d..35f039ecb272 100644
--- a/include/linux/refcount.h
+++ b/include/linux/refcount.h
@@ -266,12 +266,12 @@ bool __refcount_sub_and_test(int i, refcount_t *r, int *oldp)
if (oldp)
*oldp = old;
- if (old == i) {
+ if (old > 0 && old == i) {
smp_acquire__after_ctrl_dep();
return true;
}
- if (unlikely(old < 0 || old - i < 0))
+ if (unlikely(old <= 0 || old - i < 0))
refcount_warn_saturate(r, REFCOUNT_SUB_UAF);
return false;