Messages in this thread | | | Subject | RE: [PATCH] drivers: Conversions from kmalloc+memset to k(z|c)alloc. | Date | Fri, 21 Jul 2006 22:22:10 -0400 | From | "Brown, Len" <> |
| |
>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/
| |