summaryrefslogtreecommitdiffstats
path: root/drivers/soc
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2014-10-27 09:37:35 -0700
committerSantosh Shilimkar <ssantosh@kernel.org>2014-10-27 09:37:35 -0700
commitea6d4c07ca872b875b31e9a9bc99c21359c0f19c (patch)
tree99ac5afeb8e4617fd29784e47dd05242406cda4d /drivers/soc
parent42813295dfa3689c73e93726e7ebbbdb466dd246 (diff)
downloadtalos-op-linux-ea6d4c07ca872b875b31e9a9bc99c21359c0f19c.tar.gz
talos-op-linux-ea6d4c07ca872b875b31e9a9bc99c21359c0f19c.zip
soc: ti: knav_qmss_queue: Fix unbalanced locking ins knav_pool_create()
Don't call mutex_unlock() in the error patch if the mutex_lock() is not called. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Santosh Shilimkar <ssantosh@kernel.org>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/ti/knav_qmss_queue.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
index 0a2c8634c48b..d66aaf2c2ecd 100644
--- a/drivers/soc/ti/knav_qmss_queue.c
+++ b/drivers/soc/ti/knav_qmss_queue.c
@@ -785,7 +785,7 @@ void *knav_pool_create(const char *name,
dev_err(kdev->dev, "out of descs in region(%d) for pool(%s)\n",
region_id, name);
ret = -ENOMEM;
- goto err;
+ goto err_unlock;
}
/* Region maintains a sorted (by region offset) list of pools
@@ -815,15 +815,16 @@ void *knav_pool_create(const char *name,
dev_err(kdev->dev, "pool(%s) create failed: fragmented desc pool in region(%d)\n",
name, region_id);
ret = -ENOMEM;
- goto err;
+ goto err_unlock;
}
mutex_unlock(&knav_dev_lock);
kdesc_fill_pool(pool);
return pool;
-err:
+err_unlock:
mutex_unlock(&knav_dev_lock);
+err:
kfree(pool->name);
devm_kfree(kdev->dev, pool);
return ERR_PTR(ret);
OpenPOWER on IntegriCloud