Skip to content

Commit

Permalink
sfc: check for allocation failure
Browse files Browse the repository at this point in the history
It upsets static analyzers when we don't check for allocation failure.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Sep 4, 2013
1 parent b163b42 commit 42a5a5c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/sfc/falcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,8 @@ static int falcon_mtd_probe(struct efx_nic *efx)

/* Allocate space for maximum number of partitions */
parts = kcalloc(2, sizeof(*parts), GFP_KERNEL);
if (!parts)
return -ENOMEM;
n_parts = 0;

spi = &nic_data->spi_flash;
Expand Down

0 comments on commit 42a5a5c

Please sign in to comment.