summaryrefslogtreecommitdiffstats
path: root/drivers/staging/nvec
diff options
context:
space:
mode:
authorMarc Dietrich <marvin24@gmx.de>2012-08-19 19:03:07 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-04 13:18:14 -0700
commit4b8bf03d7f775271c2016e76011b113bc5f83c14 (patch)
treeaa96df5073ece18b4f3f16cd29e590b02726c226 /drivers/staging/nvec
parent4344379f63d3bf16d4f2cb3d6b3f3be12704173f (diff)
downloadlinux-4b8bf03d7f775271c2016e76011b113bc5f83c14.tar.bz2
staging: nvec: release sync write lock in error case
We forgot to release the sync write lock in case the async write fails. Found by rpiloose on IRC. Signed-off-by: Marc Dietrich <marvin24@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/nvec')
-rw-r--r--drivers/staging/nvec/nvec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index 3e090ecc2eac..fd84f8fd9533 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -294,8 +294,10 @@ struct nvec_msg *nvec_write_sync(struct nvec_chip *nvec,
nvec->sync_write_pending = (data[1] << 8) + data[0];
- if (nvec_write_async(nvec, data, size) < 0)
+ if (nvec_write_async(nvec, data, size) < 0) {
+ mutex_unlock(&nvec->sync_write_mutex);
return NULL;
+ }
dev_dbg(nvec->dev, "nvec_sync_write: 0x%04x\n",
nvec->sync_write_pending);