From: Dan Carpenter Date: Wed, 4 Sep 2013 15:07:27 +0000 (+0300) Subject: sfc: check for allocation failure X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=42a5a5c128ad33fe25867b838a4dade127b57aee;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git sfc: check for allocation failure It upsets static analyzers when we don't check for allocation failure. Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller --- 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;