Skip to content

Commit

Permalink
chelsio: error path fix
Browse files Browse the repository at this point in the history
Fix handling of allocation failure.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Jan 9, 2007
1 parent 45d2530 commit ab3b1c7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/chelsio/my3126.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,10 @@ static struct cphy *my3126_phy_create(adapter_t *adapter,
{
struct cphy *cphy = kzalloc(sizeof (*cphy), GFP_KERNEL);

if (cphy)
cphy_init(cphy, adapter, phy_addr, &my3126_ops, mdio_ops);
if (!cphy)
return NULL;

cphy_init(cphy, adapter, phy_addr, &my3126_ops, mdio_ops);
INIT_DELAYED_WORK(&cphy->phy_update, my3216_poll);
cphy->bmsr = 0;

Expand Down

0 comments on commit ab3b1c7

Please sign in to comment.