diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-09-04 18:07:27 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-09-04 13:07:47 -0400 |
commit | 42a5a5c128ad33fe25867b838a4dade127b57aee (patch) | |
tree | a5ce987b878e45afdda83e84a7670fe9b7d929f9 /drivers/net | |
parent | b163b42fd230ef81eae09a6fe493a33ce17b8f86 (diff) | |
download | linux-42a5a5c128ad33fe25867b838a4dade127b57aee.tar.gz linux-42a5a5c128ad33fe25867b838a4dade127b57aee.tar.bz2 linux-42a5a5c128ad33fe25867b838a4dade127b57aee.zip |
sfc: check for allocation failure
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/sfc/falcon.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/falcon.c b/drivers/net/ethernet/sfc/falcon.c index 8685f99d872a..ff5d322b9b49 100644 --- a/drivers/net/ethernet/sfc/falcon.c +++ b/drivers/net/ethernet/sfc/falcon.c @@ -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; |