Эх сурвалжийг харах

[PATCH] chelsio: fix kmalloc failure in t1_espi_create

memset() is called before check.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Eric Sesterhenn 19 жил өмнө
parent
commit
2d66806d74

+ 1 - 3
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 *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)
 	if (espi)
 		espi->adapter = adapter;
 		espi->adapter = adapter;