pxa168_eth: fix error handling in prope
commit945c7c73e2e81d68e3e2970afd95254e8f153fc9
authorDan Carpenter <error27@gmail.com>
Tue, 24 Aug 2010 06:53:33 +0000 (24 06:53 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Aug 2010 21:50:26 +0000 (24 14:50 -0700)
treecfbeb347dbc281bc786b591396d180f8ef051778
parent4169591fd7c260b2b0b4e8f4d51f63f5b15ad78a
pxa168_eth: fix error handling in prope

A couple issues here:
* Some resources weren't released.
* If alloc_etherdev() failed it would have caused a NULL dereference
  because "pep" would be null when we checked "if (pep->clk)".
* Also it's better to propagate the error codes from mdiobus_register()
  instead of just returning -ENOMEM.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/pxa168_eth.c