diff --git a/[refs] b/[refs] index 41605d4d4e69..491260915e56 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ecc38983f6c83f371fefb5a69a72e358fc7b1218 +refs/heads/master: 1f439647a4072ec64bb2e4b9290cd7be6aee8328 diff --git a/trunk/drivers/char/mem.c b/trunk/drivers/char/mem.c index 934ffafedaea..070e22e8ea9e 100644 --- a/trunk/drivers/char/mem.c +++ b/trunk/drivers/char/mem.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -889,6 +890,9 @@ static const struct file_operations kmsg_fops = { static int memory_open(struct inode * inode, struct file * filp) { + int ret = 0; + + lock_kernel(); switch (iminor(inode)) { case 1: filp->f_op = &mem_fops; @@ -932,11 +936,13 @@ static int memory_open(struct inode * inode, struct file * filp) break; #endif default: + unlock_kernel(); return -ENXIO; } if (filp->f_op && filp->f_op->open) - return filp->f_op->open(inode,filp); - return 0; + ret = filp->f_op->open(inode,filp); + unlock_kernel(); + return ret; } static const struct file_operations memory_fops = {