Commit a5f37c32 authored by Sven Schnelle's avatar Sven Schnelle Committed by Linus Torvalds

afs: add missing up_write() on return

If afs_cell_alloc() fails, afs_cells_sem doesn't get unlocked, which
leads to a deadlock.  Unlock it before returning.
Signed-off-by: default avatarSven Schnelle <svens@stackframe.org>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0e81a8ae
...@@ -138,6 +138,7 @@ struct afs_cell *afs_cell_create(const char *name, char *vllist) ...@@ -138,6 +138,7 @@ struct afs_cell *afs_cell_create(const char *name, char *vllist)
cell = afs_cell_alloc(name, vllist); cell = afs_cell_alloc(name, vllist);
if (IS_ERR(cell)) { if (IS_ERR(cell)) {
_leave(" = %ld", PTR_ERR(cell)); _leave(" = %ld", PTR_ERR(cell));
up_write(&afs_cells_sem);
return cell; return cell;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment