]> git.baikalelectronics.ru Git - kernel.git/commit
dpaa2-eth: free already allocated channels on probe defer
authorIoana Ciornei <ioana.ciornei@nxp.com>
Tue, 12 Nov 2019 16:21:52 +0000 (18:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Nov 2019 03:49:27 +0000 (19:49 -0800)
commit3df79041569d99f7d25640e817261e186488e496
tree67bd0afda0095b5cdf20780fe3fa5adf71d83d71
parent7de7c8dc4564c01fd5b1170ad41698a0a69533c0
dpaa2-eth: free already allocated channels on probe defer

The setup_dpio() function tries to allocate a number of channels equal
to the number of CPUs online. When there are not enough DPCON objects
already probed, the function will return EPROBE_DEFER. When this
happens, the already allocated channels are not freed. This results in
the incapacity of properly probing the next time around.
Fix this by freeing the channels on the error path.

Fixes: 9b3db6591ad2 ("dpaa2-eth: defer probe on object allocate")
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c