summaryrefslogtreecommitdiffstats
path: root/mm/dmapool.c
diff options
context:
space:
mode:
authorKrzysztof Hałasa <khalasa@piap.pl>2014-09-18 15:12:02 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2014-09-18 19:39:16 +0200
commit153a9f131f50420b7ce008c94f1c6374cbc460d7 (patch)
tree3e8fa74fb7be60620fdf6672db8f2bd1e0454829 /mm/dmapool.c
parentMerge tag 'regulator-v3.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/... (diff)
downloadlinux-153a9f131f50420b7ce008c94f1c6374cbc460d7.tar.xz
linux-153a9f131f50420b7ce008c94f1c6374cbc460d7.zip
Fix unbalanced mutex in dma_pool_create().
dma_pool_create() needs to unlock the mutex in error case. The bug was introduced in the 3.16 by commit cc6b664aa26d ("mm/dmapool.c: remove redundant NULL check for dev in dma_pool_create()")/ Signed-off-by: Krzysztof Hałasa <khc@piap.pl> Cc: stable@vger.kernel.org # v3.16 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/dmapool.c')
-rw-r--r--mm/dmapool.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/dmapool.c b/mm/dmapool.c
index 306baa594f95..ba8019b063e1 100644
--- a/mm/dmapool.c
+++ b/mm/dmapool.c
@@ -176,7 +176,7 @@ struct dma_pool *dma_pool_create(const char *name, struct device *dev,
if (list_empty(&dev->dma_pools) &&
device_create_file(dev, &dev_attr_pools)) {
kfree(retval);
- return NULL;
+ retval = NULL;
} else
list_add(&retval->pools, &dev->dma_pools);
mutex_unlock(&pools_lock);