]> git.baikalelectronics.ru Git - kernel.git/commit
pxa168: fix double deallocation of managed resources
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Sat, 25 Apr 2015 01:07:03 +0000 (04:07 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 26 Apr 2015 20:05:49 +0000 (16:05 -0400)
commit93014e2f4defa90b91b0d12f7dd57826094d6274
tree5868379cbbf23f5d453a25d102455f1329ace3f7
parent66a00ce170e854c48fb66eeb691314527501ae4c
pxa168: fix double deallocation of managed resources

Commit b129a0d2e245 ("net: pxa168_eth: add device tree support") starts
to use managed resources by adding devm_clk_get() and
devm_ioremap_resource(), but it leaves explicit iounmap() and clock_put()
in pxa168_eth_remove() and in failure handling code of pxa168_eth_probe().
As a result double free can happen.

The patch removes explicit resource deallocation. Also it converts
clk_disable() to clk_disable_unprepare() to make it symmetrical with
clk_prepare_enable().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/pxa168_eth.c