lkml.org 
[lkml]   [2022]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/2] ucount: Fix atomic_long_inc_below argument type
Uros Bizjak <ubizjak@gmail.com> writes:

> The type of u argument of atomic_long_inc_below should be long
> to avoid unwanted truncation to int.

Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>

>
> Fixes: f9c82a4ea89c ("Increase size of ucounts to atomic_long_t")
> Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> Cc: "Eric W. Biederman" <ebiederm@xmission.com>
> ---
> kernel/ucount.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/ucount.c b/kernel/ucount.c
> index 06ea04d44685..974ac1585009 100644
> --- a/kernel/ucount.c
> +++ b/kernel/ucount.c
> @@ -216,7 +216,7 @@ void put_ucounts(struct ucounts *ucounts)
> }
> }
>
> -static inline bool atomic_long_inc_below(atomic_long_t *v, int u)
> +static inline bool atomic_long_inc_below(atomic_long_t *v, long u)
> {
> long c, old;
> c = atomic_long_read(v);

\
 
 \ /
  Last update: 2022-07-15 20:25    [W:0.037 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site