]> git.baikalelectronics.ru Git - kernel.git/commit
dmaengine: Call module_put() after device_free_chan_resources()
authorLogan Gunthorpe <logang@deltatee.com>
Mon, 16 Dec 2019 19:01:17 +0000 (12:01 -0700)
committerVinod Koul <vkoul@kernel.org>
Tue, 24 Dec 2019 04:48:32 +0000 (10:18 +0530)
commit073998fd6d4b13c3c5995ea81b7f769b06bcadc2
tree2d5a7cc744353c15e6f89b119b58a80c5ea3d2f6
parentc0b8ac4ccf4bc4cdeea9b885aa7958251b6c2175
dmaengine: Call module_put() after device_free_chan_resources()

The module reference is taken to ensure the callbacks still exist
when they are called. If the channel holds the last reference to the
module, the module can disappear before device_free_chan_resources() is
called and would cause a call into free'd memory.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Link: https://lore.kernel.org/r/20191216190120.21374-3-logang@deltatee.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/dmaengine.c