lkml.org 
[lkml]   [2006]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRE: [PATCH] drivers: Conversions from kmalloc+memset to k(z|c)alloc.
Date
From

>diff --git a/drivers/acpi/hotkey.c b/drivers/acpi/hotkey.c
>index 32c9d88..037d022 100644
>--- a/drivers/acpi/hotkey.c
>+++ b/drivers/acpi/hotkey.c
>@@ -246,10 +246,8 @@ static char *format_result(union acpi_ob
> {
> char *buf = NULL;
>
>- buf = (char *)kmalloc(RESULT_STR_LEN, GFP_KERNEL);
>- if (buf)
>- memset(buf, 0, RESULT_STR_LEN);
>- else
>+ buf = kzalloc(RESULT_STR_LEN, GFP_KERNEL);
>+ if (!buf)
> goto do_fail;

Go ahead and delete the '= NULL' while you're there.

Acked-by: Len Brown <len.brown@intel.com>

thanks,
-Len
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-07-22 04:25    [W:0.020 / U:0.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site