chelsio: error path fix

Fix handling of allocation failure.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>

authored by Stephen Hemminger and committed by Jeff Garzik ab3b1c7e 45d25301

+3 -2
+3 -2
drivers/net/chelsio/my3126.c
··· 170 170 { 171 171 struct cphy *cphy = kzalloc(sizeof (*cphy), GFP_KERNEL); 172 172 173 - if (cphy) 174 - cphy_init(cphy, adapter, phy_addr, &my3126_ops, mdio_ops); 173 + if (!cphy) 174 + return NULL; 175 175 176 + cphy_init(cphy, adapter, phy_addr, &my3126_ops, mdio_ops); 176 177 INIT_DELAYED_WORK(&cphy->phy_update, my3216_poll); 177 178 cphy->bmsr = 0; 178 179