[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <26c09145-b3d2-52e0-4c31-bfb11a78be31@akamai.com>
Date: Tue, 10 Dec 2019 14:58:07 -0500
From: Jason Baron <jbaron@...mai.com>
To: Jim Cromie <jim.cromie@...il.com>, linux-kernel@...r.kernel.org,
akpm@...uxfoundation.org
Cc: gregkh@...uxfoundation.org, linux@...musvillemoes.dk,
kbuild test robot <lkp@...el.com>
Subject: Re: [PATCH v4 06/16] dyndbg: fix a BUG_ON in ddebug_describe_flags
On 12/9/19 9:27 PM, Jim Cromie wrote:
> ddebug_describe_flags currently fills a caller provided string buffer,
> after testing its size (also passed) in a BUG_ON. Fix this with a
> struct containing a known-big-enough string buffer, and passing it
> instead.
>
> Also simplify ddebug_describe_flags sig, and de-ref the struct in the
> caller; this makes function reusable (soon) in contexts where flags
> are already unpacked.
>
> -v3 fix compile err introduced in patchset grooming.
> Reported-by: kbuild test robot <lkp@...el.com>
>
> Signed-off-by: Jim Cromie <jim.cromie@...il.com>
> ---
> lib/dynamic_debug.c | 31 +++++++++++++++----------------
> 1 file changed, 15 insertions(+), 16 deletions(-)
>
> diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
> index b5fb0aa0fbc3..49cb24948e12 100644
> --- a/lib/dynamic_debug.c
> +++ b/lib/dynamic_debug.c
> @@ -62,6 +62,8 @@ struct ddebug_iter {
> unsigned int idx;
> };
>
> +struct flagsbuf { char buf[12]; }; /* big enough to hold all the flags */
ARRAY_SIZE(opt_array) + 1
max number of flags + string termination.
Powered by blists - more mailing lists