]> git.baikalelectronics.ru Git - kernel.git/commit
stmmac: dwmac-sunxi: Call exit cleanup function in probe error path
authorChen-Yu Tsai <wens@csie.org>
Fri, 11 Dec 2015 10:03:49 +0000 (18:03 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Dec 2015 21:11:59 +0000 (16:11 -0500)
commit66921eacc9d60fbca82370bd7206770a285533f7
tree9ea09e2e1a8d6dc4f9eec6210542cbffe52e3030
parent8f6af8b13252ca41c322405ba14a3dbcc36875cb
stmmac: dwmac-sunxi: Call exit cleanup function in probe error path

dwmac-sunxi has 2 callbacks that were called from stmmac_platform as
part of the probe and remove sequences.

Ater the conversion of dwmac-sunxi into a standalone platform driver,
the .init function is called before calling into the stmmac driver
core, but .exit is not called to clean up if stmmac returns an error.

This patch fixes the probe error path. This properly cleans up and
releases resources when the driver core fails to probe.

Cc: Joachim Eastwood <manabian@gmail.com>
Fixes: 1eb9fda3afae ("stmmac: dwmac-sunxi: turn setup callback into a
      probe function")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c