瀏覽代碼

uml-harddog: BKL pushdown

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

+ 3 - 0
arch/um/drivers/harddog_kern.c

@@ -66,6 +66,7 @@ static int harddog_open(struct inode *inode, struct file *file)
 	int err = -EBUSY;
 	int err = -EBUSY;
 	char *sock = NULL;
 	char *sock = NULL;
 
 
+	lock_kernel();
 	spin_lock(&lock);
 	spin_lock(&lock);
 	if(timer_alive)
 	if(timer_alive)
 		goto err;
 		goto err;
@@ -82,9 +83,11 @@ static int harddog_open(struct inode *inode, struct file *file)
 
 
 	timer_alive = 1;
 	timer_alive = 1;
 	spin_unlock(&lock);
 	spin_unlock(&lock);
+	unlock_kernel();
 	return nonseekable_open(inode, file);
 	return nonseekable_open(inode, file);
 err:
 err:
 	spin_unlock(&lock);
 	spin_unlock(&lock);
+	unlock_kernel();
 	return err;
 	return err;
 }
 }