diff options
Diffstat (limited to 'lib/refcount.c')
| -rw-r--r-- | lib/refcount.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/refcount.c b/lib/refcount.c index 1d33366189d1..aa09ad3c30b0 100644 --- a/lib/refcount.c +++ b/lib/refcount.c | |||
| @@ -58,7 +58,7 @@ bool refcount_add_not_zero(unsigned int i, refcount_t *r) | |||
| 58 | val = old; | 58 | val = old; |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | WARN(new == UINT_MAX, "refcount_t: saturated; leaking memory.\n"); | 61 | WARN_ONCE(new == UINT_MAX, "refcount_t: saturated; leaking memory.\n"); |
| 62 | 62 | ||
| 63 | return true; | 63 | return true; |
| 64 | } | 64 | } |
| @@ -66,7 +66,7 @@ EXPORT_SYMBOL_GPL(refcount_add_not_zero); | |||
| 66 | 66 | ||
| 67 | void refcount_add(unsigned int i, refcount_t *r) | 67 | void refcount_add(unsigned int i, refcount_t *r) |
| 68 | { | 68 | { |
| 69 | WARN(!refcount_add_not_zero(i, r), "refcount_t: addition on 0; use-after-free.\n"); | 69 | WARN_ONCE(!refcount_add_not_zero(i, r), "refcount_t: addition on 0; use-after-free.\n"); |
| 70 | } | 70 | } |
| 71 | EXPORT_SYMBOL_GPL(refcount_add); | 71 | EXPORT_SYMBOL_GPL(refcount_add); |
| 72 | 72 | ||
| @@ -97,7 +97,7 @@ bool refcount_inc_not_zero(refcount_t *r) | |||
| 97 | val = old; | 97 | val = old; |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | WARN(new == UINT_MAX, "refcount_t: saturated; leaking memory.\n"); | 100 | WARN_ONCE(new == UINT_MAX, "refcount_t: saturated; leaking memory.\n"); |
| 101 | 101 | ||
| 102 | return true; | 102 | return true; |
| 103 | } | 103 | } |
| @@ -111,7 +111,7 @@ EXPORT_SYMBOL_GPL(refcount_inc_not_zero); | |||
| 111 | */ | 111 | */ |
| 112 | void refcount_inc(refcount_t *r) | 112 | void refcount_inc(refcount_t *r) |
| 113 | { | 113 | { |
| 114 | WARN(!refcount_inc_not_zero(r), "refcount_t: increment on 0; use-after-free.\n"); | 114 | WARN_ONCE(!refcount_inc_not_zero(r), "refcount_t: increment on 0; use-after-free.\n"); |
| 115 | } | 115 | } |
| 116 | EXPORT_SYMBOL_GPL(refcount_inc); | 116 | EXPORT_SYMBOL_GPL(refcount_inc); |
| 117 | 117 | ||
| @@ -125,7 +125,7 @@ bool refcount_sub_and_test(unsigned int i, refcount_t *r) | |||
| 125 | 125 | ||
| 126 | new = val - i; | 126 | new = val - i; |
| 127 | if (new > val) { | 127 | if (new > val) { |
| 128 | WARN(new > val, "refcount_t: underflow; use-after-free.\n"); | 128 | WARN_ONCE(new > val, "refcount_t: underflow; use-after-free.\n"); |
| 129 | return false; | 129 | return false; |
| 130 | } | 130 | } |
| 131 | 131 | ||
| @@ -164,7 +164,7 @@ EXPORT_SYMBOL_GPL(refcount_dec_and_test); | |||
| 164 | 164 | ||
| 165 | void refcount_dec(refcount_t *r) | 165 | void refcount_dec(refcount_t *r) |
| 166 | { | 166 | { |
| 167 | WARN(refcount_dec_and_test(r), "refcount_t: decrement hit 0; leaking memory.\n"); | 167 | WARN_ONCE(refcount_dec_and_test(r), "refcount_t: decrement hit 0; leaking memory.\n"); |
| 168 | } | 168 | } |
| 169 | EXPORT_SYMBOL_GPL(refcount_dec); | 169 | EXPORT_SYMBOL_GPL(refcount_dec); |
| 170 | 170 | ||
| @@ -204,7 +204,7 @@ bool refcount_dec_not_one(refcount_t *r) | |||
| 204 | 204 | ||
| 205 | new = val - 1; | 205 | new = val - 1; |
| 206 | if (new > val) { | 206 | if (new > val) { |
| 207 | WARN(new > val, "refcount_t: underflow; use-after-free.\n"); | 207 | WARN_ONCE(new > val, "refcount_t: underflow; use-after-free.\n"); |
| 208 | return true; | 208 | return true; |
| 209 | } | 209 | } |
| 210 | 210 | ||
