lkml.org 
[lkml]   [2022]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3 1/3] jump_label: Prevent key->enabled int overflow
From
On 11/14/22 16:24, Jason Baron wrote:
>
[..]
>> @@ -148,16 +167,23 @@ void static_key_slow_inc_cpuslocked(struct static_key *key)
>> */
>> atomic_set_release(&key->enabled, 1);
>> } else {
>> - atomic_inc(&key->enabled);
>> + if (WARN_ON_ONCE(static_key_fast_inc(key))) {
>
> Shouldn't that be negated to catch the overflow:
>
> if (WARN_ON_ONCE(!static_key_fast_inc(key)))

Oh, that's just embarrassing!
I wonder how did I miss it during tests..

Thanks for spotting this, will fix in v4,
Dmitry

\
 
 \ /
  Last update: 2022-11-14 18:14    [W:0.043 / U:1.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site