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>
This commit is contained in:
Dan Carpenter 2013-09-04 18:07:27 +03:00 коммит произвёл David S. Miller
Родитель b163b42fd2
Коммит 42a5a5c128
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -893,6 +893,8 @@ static int falcon_mtd_probe(struct efx_nic *efx)
/* Allocate space for maximum number of partitions */ /* Allocate space for maximum number of partitions */
parts = kcalloc(2, sizeof(*parts), GFP_KERNEL); parts = kcalloc(2, sizeof(*parts), GFP_KERNEL);
if (!parts)
return -ENOMEM;
n_parts = 0; n_parts = 0;
spi = &nic_data->spi_flash; spi = &nic_data->spi_flash;