[<prev] [next>] [day] [month] [year] [list]
Message-ID: <m3tx4513a5.fsf@t19.piap.pl>
Date: Thu, 18 Sep 2014 15:12:02 +0200
From: khalasa@...p.pl (Krzysztof Hałasa)
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: lkml <linux-kernel@...r.kernel.org>
Subject: [PATCH] Fix unbalanced mutex in dma_pool_create().
dma_pool_create() needs to unlock the mutex in error case.
The bug has been present starting with v3.16-rc1 (cc6b664a).
Signed-off-by: Krzysztof Hałasa <khc@...p.pl>
Cc: stable@...r.kernel.org
--- a/mm/dmapool.c
+++ b/mm/dmapool.c
@@ -174,11 +174,11 @@ struct dma_pool *dma_pool_create(const char *name, struct device *dev,
mutex_lock(&pools_lock);
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);
return retval;
--
Krzysztof Halasa
Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists