From: Eric Sesterhenn Date: Sat, 4 Mar 2006 22:16:00 +0000 (+0300) Subject: [PATCH] chelsio: fix kmalloc failure in t1_espi_create X-Git-Tag: v2.6.16-rc6~111^2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d66806d740eeb410aa785bd7fba3bd24bb082c1;p=linux-2.6 [PATCH] chelsio: fix kmalloc failure in t1_espi_create memset() is called before check. Signed-off-by: Eric Sesterhenn Signed-off-by: Alexey Dobriyan Signed-off-by: Jeff Garzik --- diff --git a/drivers/net/chelsio/espi.c b/drivers/net/chelsio/espi.c index 230642571c..e824acaf18 100644 --- a/drivers/net/chelsio/espi.c +++ b/drivers/net/chelsio/espi.c @@ -296,9 +296,7 @@ void t1_espi_destroy(struct peespi *espi) struct peespi *t1_espi_create(adapter_t *adapter) { - struct peespi *espi = kmalloc(sizeof(*espi), GFP_KERNEL); - - memset(espi, 0, sizeof(*espi)); + struct peespi *espi = kzalloc(sizeof(*espi), GFP_KERNEL); if (espi) espi->adapter = adapter;