summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-01-10 00:57:12 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-12 14:04:13 +0100
commit6ad1095990328e7e4b3a0e260825ad4b6406785a (patch)
treed020effd1b05032e866bdb425836150a3d526f2c
parentuio: uio_fsl_elbc_gpcm: new driver (diff)
downloadlinux-6ad1095990328e7e4b3a0e260825ad4b6406785a.tar.xz
linux-6ad1095990328e7e4b3a0e260825ad4b6406785a.zip
coresight-etm: unlock on error paths in mode_store()
There are some missing unlocks on the error paths. Fixes: a939fc5a71ad ('coresight-etm: add CoreSight ETM/PTM driver') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/coresight/coresight-etm3x.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/coresight/coresight-etm3x.c b/drivers/coresight/coresight-etm3x.c
index d9e3ed6aa857..369cac00afaa 100644
--- a/drivers/coresight/coresight-etm3x.c
+++ b/drivers/coresight/coresight-etm3x.c
@@ -573,7 +573,8 @@ static ssize_t mode_store(struct device *dev,
if (drvdata->mode & ETM_MODE_STALL) {
if (!(drvdata->etmccr & ETMCCR_FIFOFULL)) {
dev_warn(drvdata->dev, "stall mode not supported\n");
- return -EINVAL;
+ ret = -EINVAL;
+ goto err_unlock;
}
drvdata->ctrl |= ETMCR_STALL_MODE;
} else
@@ -582,7 +583,8 @@ static ssize_t mode_store(struct device *dev,
if (drvdata->mode & ETM_MODE_TIMESTAMP) {
if (!(drvdata->etmccer & ETMCCER_TIMESTAMP)) {
dev_warn(drvdata->dev, "timestamp not supported\n");
- return -EINVAL;
+ ret = -EINVAL;
+ goto err_unlock;
}
drvdata->ctrl |= ETMCR_TIMESTAMP_EN;
} else
@@ -595,6 +597,10 @@ static ssize_t mode_store(struct device *dev,
spin_unlock(&drvdata->spinlock);
return size;
+
+err_unlock:
+ spin_unlock(&drvdata->spinlock);
+ return ret;
}
static DEVICE_ATTR_RW(mode);