]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
sfc: Add check for memory allocation failure in falcon_probe_nic()
authorBen Hutchings <bhutchings@solarflare.com>
Wed, 3 Sep 2008 14:07:50 +0000 (15:07 +0100)
committerJeff Garzik <jgarzik@redhat.com>
Wed, 24 Sep 2008 22:54:34 +0000 (18:54 -0400)
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/net/sfc/falcon.c

index e0c0b23f94ef9bb34f959c00f99d0e1c155a462c..636fe824b8633d38fbcb94621f380e3647f45053 100644 (file)
@@ -2758,6 +2758,8 @@ int falcon_probe_nic(struct efx_nic *efx)
 
        /* Allocate storage for hardware specific data */
        nic_data = kzalloc(sizeof(*nic_data), GFP_KERNEL);
+       if (!nic_data)
+               return -ENOMEM;
        efx->nic_data = nic_data;
 
        /* Determine number of ports etc. */