From: Haavard Skinnemoen Date: Thu, 15 Nov 2007 00:59:27 +0000 (-0800) Subject: dmaengine: fix broken device refcounting X-Git-Tag: v2.6.24-rc3~98 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=348badf1e825323c419dd118f65783db0f7d2ec8;p=pandora-kernel.git dmaengine: fix broken device refcounting When a DMA device is unregistered, its reference count is decremented twice for each channel: Once dma_class_dev_release() and once in dma_chan_cleanup(). This may result in the DMA device driver's remove() function completing before all channels have been cleaned up, causing lots of use-after-free fun. Fix it by incrementing the device's reference count twice for each channel during registration. [dan.j.williams@intel.com: kill unnecessary client refcounting] Signed-off-by: Haavard Skinnemoen Signed-off-by: Dan Williams Signed-off-by: Shannon Nelson Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed