浏览代码

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: Sven Schnelle <svens@stackframe.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Sven Schnelle 17 年之前
父节点
当前提交
a5f37c3252
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      fs/afs/cell.c

+ 1 - 0
fs/afs/cell.c

@@ -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;
 	}
 	}