]> git.baikalelectronics.ru Git - kernel.git/commit
net: ethernet: davinci_emac: fix error handling in probe()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 31 May 2018 06:44:49 +0000 (09:44 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 31 May 2018 20:12:00 +0000 (16:12 -0400)
commitf4efc36b7a92c72d7595c0d1ab79765897c2ddcf
tree792ab5311bd824a95523f7489ee3344fa07bed6d
parent4226577851572074eeb74797ff6788b532bf524f
net: ethernet: davinci_emac: fix error handling in probe()

The current error handling code has an issue where it does:

if (priv->txchan)
cpdma_chan_destroy(priv->txchan);

The problem is that ->txchan is either valid or an error pointer (which
would lead to an Oops).  I've changed it to use multiple error labels so
that the test can be removed.

Also there were some missing calls to netif_napi_del().

Fixes: 61eebf006148 ("net: davinci_emac: switch to new cpdma layer")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/davinci_emac.c