mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-28 12:25:31 +00:00
coresight-etm: unlock on error paths in mode_store()
There are some missing unlocks on the error paths.
Fixes: a939fc5a71
('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>
This commit is contained in:
parent
fbc4a8a857
commit
6ad1095990
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user