提交 42a5a5c1 编写于 作者: D Dan Carpenter 提交者: David S. Miller

sfc: check for allocation failure

It upsets static analyzers when we don't check for allocation failure.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b163b42f
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册