Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173194
b: refs/heads/master
c: 205153a
h: refs/heads/master
v: v3
  • Loading branch information
Frederic Weisbecker authored and Thomas Gleixner committed Oct 14, 2009
1 parent 0c7b8ff commit b01beb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 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: 4c2aedc2543248c3fdc8c06c662b589d36c93bbb
refs/heads/master: 205153aa40b7fb36dc7fe76c1798584ace55b288
17 changes: 5 additions & 12 deletions trunk/drivers/char/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#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 @@ -892,29 +891,23 @@ static int memory_open(struct inode *inode, struct file *filp)
{
int minor;
const struct memdev *dev;
int ret = -ENXIO;

lock_kernel();

minor = iminor(inode);
if (minor >= ARRAY_SIZE(devlist))
goto out;
return -ENXIO;

dev = &devlist[minor];
if (!dev->fops)
goto out;
return -ENXIO;

filp->f_op = dev->fops;
if (dev->dev_info)
filp->f_mapping->backing_dev_info = dev->dev_info;

if (dev->fops->open)
ret = dev->fops->open(inode, filp);
else
ret = 0;
out:
unlock_kernel();
return ret;
return dev->fops->open(inode, filp);

return 0;
}

static const struct file_operations memory_fops = {
Expand Down

0 comments on commit b01beb7

Please sign in to comment.