Re: [PATCH 11/25] dynamic_debug: factor show_ddebug_query out of ddebug_parse_query

Bart Van Assche
2011-07-26T07:15:46Z

On Mon, Jul 25, 2011 at 11:42 PM, Jim Cromie <jim.cromie@gmail.com> wrote:
> @@ -435,6 +448,10 @@ static int ddebug_exec_queries(char *query)
>        char *split;
>        int i, errs = 0, exitcode = 0, rc;
>
> +       prbuf_query = kmalloc(1024, GFP_KERNEL);
> +       if (prbuf_query == NULL)
> +               return -ENOMEM;
> +
>        for (i = 0; query; query = split) {
>                split = strpbrk(query, ";\n");
>                if (split)
> @@ -452,6 +469,7 @@ static int ddebug_exec_queries(char *query)
>                }
>                i++;
>        }
> +       kfree(prbuf_query);

The above changes invoke memory allocation and deallocation. But the
allocated buffer isn't used anywhere - neither in this patch nor in
any later patch ???

Bart.