[flashrom] [PATCH 2/3] Factor out DMI string reading into subfunction

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Thu Feb 25 11:59:29 CET 2010


On 24.02.2010 14:28, Michael Karcher wrote:
> Signed-off-by: Michael Karcher <flashrom at mkarcher.dialup.fu-berlin.de>
>
> diff --git a/dmi.c b/dmi.c
> index c80a568..100767f 100644
> --- a/dmi.c
> +++ b/dmi.c
> @@ -54,55 +54,56 @@ char *dmistrings[DMI_ID_INVALID];
> [...]
> +	printf_debug("DMI string %s: \"%s\"\n", string_name, answerbuf);
> +
> +	return strdup(answerbuf);
> +}
>   

If strdup runs out of memory, we'll return NULL without warning that we
ran out of memory.
Same coding style nitpicks as with the other patch.

I trust you to explain/fix this.
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>

Regards,
Carl-Daniel

-- 
"I do consider assignment statements and pointer variables to be among
computer science's most valuable treasures."
-- Donald E. Knuth





More information about the flashrom mailing list