Skip to content

Commit 42a5a5c

Browse files
Dan Carpenterdavem330
authored andcommitted
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>
1 parent b163b42 commit 42a5a5c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/ethernet/sfc/falcon.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,8 @@ static int falcon_mtd_probe(struct efx_nic *efx)
893893

894894
/* Allocate space for maximum number of partitions */
895895
parts = kcalloc(2, sizeof(*parts), GFP_KERNEL);
896+
if (!parts)
897+
return -ENOMEM;
896898
n_parts = 0;
897899

898900
spi = &nic_data->spi_flash;

0 commit comments

Comments
 (0)