]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/ethernet/sfc/falcon.c
sfc: check for allocation failure
[karo-tx-linux.git] / drivers / net / ethernet / sfc / falcon.c
index 8685f99d872a20a24bf7f8101e9182d5d3524439..ff5d322b9b49698842bdfc7a19117c8054829c86 100644 (file)
@@ -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;