Skip to content

Commit

Permalink
[PATCH] chelsio: fix kmalloc failure in t1_espi_create
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Sesterhenn authored and Jeff Garzik committed Mar 6, 2006
1 parent d033d93 commit 2d66806
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/chelsio/espi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2d66806

Please sign in to comment.