diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2008-05-16 21:20:20 +0100 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-05-22 05:59:34 -0400 |
commit | 9b7bfc4c4c601a5cb368751f60cac054492c45f5 (patch) | |
tree | c5cf9c6c582542ad91e2c0bf0fffab2a6f38ee43 /drivers/net/sfc/xfp_phy.c | |
parent | d3208b5ebae9e62c32f0cf74dce1d4ddfac3f895 (diff) |
sfc: Added checks for heap allocation failure
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/sfc/xfp_phy.c')
-rw-r--r-- | drivers/net/sfc/xfp_phy.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/sfc/xfp_phy.c b/drivers/net/sfc/xfp_phy.c index cf75fab3e77e..f3684ad28887 100644 --- a/drivers/net/sfc/xfp_phy.c +++ b/drivers/net/sfc/xfp_phy.c @@ -85,6 +85,8 @@ static int xfp_phy_init(struct efx_nic *efx) int rc; phy_data = kzalloc(sizeof(struct xfp_phy_data), GFP_KERNEL); + if (!phy_data) + return -ENOMEM; efx->phy_data = phy_data; EFX_INFO(efx, "XFP: PHY ID reg %x (OUI %x model %x revision" |