afs: add missing up_write() on return
authorSven Schnelle <svens@stackframe.org>
Wed, 2 Apr 2008 12:17:18 +0000 (13:17 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 2 Apr 2008 14:40:54 +0000 (07:40 -0700)
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>
fs/afs/cell.c

index 788865df1bc92689debaf1545c59fe6ab48d2ea8..584bb0f9c36a35cdd5ed4234a83ba927e0d04e5e 100644 (file)
@@ -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;
        }