提交 2d66806d 编写于 作者: E Eric Sesterhenn 提交者: Jeff Garzik

[PATCH] chelsio: fix kmalloc failure in t1_espi_create

memset() is called before check.
Signed-off-by: NEric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 d033d934
...@@ -296,9 +296,7 @@ void t1_espi_destroy(struct peespi *espi) ...@@ -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); struct peespi *espi = kzalloc(sizeof(*espi), GFP_KERNEL);
memset(espi, 0, sizeof(*espi));
if (espi) if (espi)
espi->adapter = adapter; espi->adapter = adapter;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册