Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100281
b: refs/heads/master
c: 1f43964
h: refs/heads/master
i:
  100279: 6f12125
v: v3
  • Loading branch information
Jonathan Corbet committed Jun 20, 2008
1 parent af6ee29 commit 1c857a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ecc38983f6c83f371fefb5a69a72e358fc7b1218
refs/heads/master: 1f439647a4072ec64bb2e4b9290cd7be6aee8328
10 changes: 8 additions & 2 deletions trunk/drivers/char/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <linux/bootmem.h>
#include <linux/splice.h>
#include <linux/pfn.h>
#include <linux/smp_lock.h>

#include <asm/uaccess.h>
#include <asm/io.h>
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit 1c857a6

Please sign in to comment.