summaryrefslogtreecommitdiff
path: root/include/linux/refcount.h
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2024-08-30 14:14:29 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2024-08-30 15:00:53 +0200
commit3973a8d052829dcc5193fb6330dcd13c2b7127ca (patch)
treeb02f355e874ec5997196dfea09ad796419c38e7d /include/linux/refcount.h
parente75356ef5baef69e9f577023c453d91a902dc082 (diff)
parent6d0ebb3904853d18eeec7af5e8b4ca351b6f9025 (diff)
Merge drm/drm-next into drm-misc-next
Backmerging to get fixes from v6.11-rc5. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
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;