From: Sumit Semwal Date: Tue, 5 May 2015 09:26:15 +0000 (+0530) Subject: dma-buf: add ref counting for module as exporter X-Git-Tag: omap-for-v4.3/legacy-v2-signed~118^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9abdffe286c1532a54d5aee31571d3029be4026c;p=pandora-kernel.git dma-buf: add ref counting for module as exporter Add reference counting on a kernel module that exports dma-buf and implements its operations. This prevents the module from being unloaded while DMABUF file is in use. The original patch [1] was submitted by Tomasz Stanislawski, but this is a simpler way to do it. v3: call module_put() as late as possible, per gregkh's comment. v2: move owner to struct dma_buf, and use DEFINE_DMA_BUF_EXPORT_INFO macro to simplify the change. Acked-by: Greg Kroah-Hartman Signed-off-by: Sumit Semwal [1]: https://lkml.org/lkml/2012/8/8/163 --- Reading git-diff-tree failed