diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-09-04 17:07:27 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-09-04 19:07:47 +0200 |
commit | 42a5a5c128ad33fe25867b838a4dade127b57aee (patch) | |
tree | a5ce987b878e45afdda83e84a7670fe9b7d929f9 /drivers | |
parent | Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsh... (diff) | |
download | linux-42a5a5c128ad33fe25867b838a4dade127b57aee.tar.xz 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')
-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; |