瀏覽代碼

flash: BKL pushdown

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Arnd Bergmann 17 年之前
父節點
當前提交
78abb6ac91
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      drivers/sbus/char/flash.c

+ 5 - 1
drivers/sbus/char/flash.c

@@ -127,9 +127,13 @@ flash_read(struct file * file, char __user * buf,
 static int
 flash_open(struct inode *inode, struct file *file)
 {
-	if (test_and_set_bit(0, (void *)&flash.busy) != 0)
+	lock_kernel();
+	if (test_and_set_bit(0, (void *)&flash.busy) != 0) {
+		unlock_kernel();
 		return -EBUSY;
+	}
 
+	unlock_kernel();
 	return 0;
 }