Skip to content

Commit

Permalink
afs: add missing up_write() on return
Browse files Browse the repository at this point in the history
If afs_cell_alloc() fails, afs_cells_sem doesn't get unlocked, which
leads to a deadlock.  Unlock it before returning.

Signed-off-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Sven Schnelle authored and Linus Torvalds committed Apr 2, 2008
1 parent 0e81a8a commit a5f37c3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/afs/cell.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ struct afs_cell *afs_cell_create(const char *name, char *vllist)
cell = afs_cell_alloc(name, vllist);
if (IS_ERR(cell)) {
_leave(" = %ld", PTR_ERR(cell));
up_write(&afs_cells_sem);
return cell;
}

Expand Down

0 comments on commit a5f37c3

Please sign in to comment.