sfc: check for allocation failure
Subsystems (4)
PATCH 1/1 sfc: check for allocation failure
It upsets static analyzers when we don't check for allocation failure.
drivers/net/ethernet/sfc/mtd.c +2 -0
@@ -384,6 +384,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;
Quoted 3 lines · Dan Carpenter
It upsets static analyzers when we don't check for allocation failure.
Signed-off-by Dan Carpenter <[email protected]>
Thanks Dan.
Ben.
Quoted 13 lines
drivers/net/ethernet/sfc/mtd.c +2
-0@@ -384,6 +384,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;
Signature · 3 lines
Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
David Miller
maintainerFrom: Dan Carpenter <[email protected]>
Date: Mon, 2 Sep 2013 12:04:42 +0300
Quoted 3 lines
It upsets static analyzers when we don't check for allocation failure.
Signed-off-by Dan Carpenter <[email protected]>
This applies cleanly neither to net nor net-next, please send me a version that does.
Thanks.
Quoted 9 lines · David Miller
From: Dan Carpenter <[email protected]>
Date: Mon, 2 Sep 2013 12:04:42 +0300Quoted 3 lines
It upsets static analyzers when we don't check for allocation failure.
Signed-off-by Dan Carpenter <[email protected]>This applies cleanly neither to net nor net-next, please send me a version that does.
Oh yes, I failed to spot the filename. That function has since been moved to falcon.c.
Ben.
Signature · 3 lines
Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
PATCH v2 1/1 sfc: check for allocation failure
In reply to David MillerIt upsets static analyzers when we don't check for allocation failure.
---
v2: rebased on latest linux-next
drivers/net/ethernet/sfc/falcon.c +2 -0
@@ -894,6 +894,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;
Quoted 3 lines · Dan Carpenter
It upsets static analyzers when we don't check for allocation failure.
Signed-off-by Dan Carpenter <[email protected]>
Quoted 16 lines
---
v2: rebased on latest linux-nextdrivers/net/ethernet/sfc/falcon.c +2
-0@@ -894,6 +894,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;
Signature · 3 lines
Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
From: Dan Carpenter <[email protected]>
Date: Wed, 4 Sep 2013 18:07:27 +0300
Quoted 5 lines
It upsets static analyzers when we don't check for allocation failure.
Signed-off-by Dan Carpenter <[email protected]>---
v2: rebased on latest linux-next
Applied, thanks Dan.