Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Dan Carpenter and committed by
David S. Miller
42a5a5c1 b163b42f

+2
+2
drivers/net/ethernet/sfc/falcon.c
··· 893 893 894 894 /* Allocate space for maximum number of partitions */ 895 895 parts = kcalloc(2, sizeof(*parts), GFP_KERNEL); 896 + if (!parts) 897 + return -ENOMEM; 896 898 n_parts = 0; 897 899 898 900 spi = &nic_data->spi_flash;