projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b163b42
)
sfc: check for allocation failure
author
Dan Carpenter
<dan.carpenter@oracle.com>
Wed, 4 Sep 2013 15:07:27 +0000
(18:07 +0300)
committer
David S. Miller
<davem@davemloft.net>
Wed, 4 Sep 2013 17:07:47 +0000
(13:07 -0400)
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>
drivers/net/ethernet/sfc/falcon.c
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/sfc/falcon.c
b/drivers/net/ethernet/sfc/falcon.c
index 8685f99d872a20a24bf7f8101e9182d5d3524439..ff5d322b9b49698842bdfc7a19117c8054829c86 100644
(file)
--- a/
drivers/net/ethernet/sfc/falcon.c
+++ b/
drivers/net/ethernet/sfc/falcon.c
@@
-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;