lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 25 Jul 2011 07:56:00 -0600
From:	Jim Cromie <jim.cromie@...il.com>
To:	Bart Van Assche <bvanassche@....org>
Cc:	jbaron@...hat.com, linux-kernel@...r.kernel.org, joe@...ches.com,
	gregkh@...e.de, gnb@...h.org
Subject: Re: [PATCH 08/21] dynamic_debug: factor show_ddebug_query out of ddebug_parse_query

On Mon, Jul 25, 2011 at 5:10 AM, Bart Van Assche <bvanassche@....org> wrote:
> On Sat, Jul 16, 2011 at 11:32 PM, Jim Cromie <jim.cromie@...il.com> wrote:
>> using kasprintf would entail;
>> - a local char* var,
>> - a call to the string-producer (show_ddebug_query above)
>> - a kfree(var)
>> all in the caller context.
>> Using a preallocated string buffer avoids this,
>> and is slightly more efficient wrt kallocs.
>
> I'm still missing an explanation why the static variable "prbuf_query"
> is necessary. Wouldn't eliminating that static variable make the code
> more elegant ?
>
> Bart.
>

After further consideration, Ive done it as you suggest.
Its a few more lines of code, but less complex -
all kfrees follow use immediately, no buffer mgmt at a distance.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ