From: Ben Hutchings Date: Wed, 3 Sep 2008 14:07:50 +0000 (+0100) Subject: sfc: Add check for memory allocation failure in falcon_probe_nic() X-Git-Tag: v2.6.28-rc1~717^2~195^2~55 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=88c59425139c0cd9984ca8f1ef577959326446d3;p=linux-2.6-omap-h63xx.git sfc: Add check for memory allocation failure in falcon_probe_nic() Signed-off-by: Ben Hutchings Signed-off-by: Jeff Garzik --- diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index e0c0b23f94e..636fe824b86 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c @@ -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. */