Commit 153a9f13 authored by Krzysztof Hałasa's avatar Krzysztof Hałasa Committed by Linus Torvalds

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 cc6b664a ("mm/dmapool.c: remove
redundant NULL check for dev in dma_pool_create()")/
Signed-off-by: default avatarKrzysztof Hałasa <khc@piap.pl>
Cc: stable@vger.kernel.org  # v3.16
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent bd26a74e
...@@ -176,7 +176,7 @@ struct dma_pool *dma_pool_create(const char *name, struct device *dev, ...@@ -176,7 +176,7 @@ struct dma_pool *dma_pool_create(const char *name, struct device *dev,
if (list_empty(&dev->dma_pools) && if (list_empty(&dev->dma_pools) &&
device_create_file(dev, &dev_attr_pools)) { device_create_file(dev, &dev_attr_pools)) {
kfree(retval); kfree(retval);
return NULL; retval = NULL;
} else } else
list_add(&retval->pools, &dev->dma_pools); list_add(&retval->pools, &dev->dma_pools);
mutex_unlock(&pools_lock); mutex_unlock(&pools_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment