Skip to content

Commit

Permalink
staging: nvec: release sync write lock in error case
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marc Dietrich authored and Greg Kroah-Hartman committed Sep 4, 2012
1 parent 4344379 commit 4b8bf03
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/staging/nvec/nvec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4b8bf03

Please sign in to comment.