Skip to contentSkip to conversation

Fix unbalanced mutex in dma_pool_create().

PATCH New Krzysztof Hałasa 1 participant 1 message Sep 18, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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).

mm/dmapool.c +1 -1
@@ -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;
Signature · 4 lines
Krzysztof Halasa

Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland