Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 117458
b: refs/heads/master
c: a518ab9
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and Al Viro committed Oct 23, 2008
1 parent 3919ceb commit 8e35784
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 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: ca30bc99527ab968707bafc09e38807de7e70c4a
refs/heads/master: a518ab9329041411526ab8e05edfda7e2715244f
21 changes: 14 additions & 7 deletions trunk/fs/char_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,22 @@ static int chrdev_open(struct inode *inode, struct file *filp)
cdev_put(new);
if (ret)
return ret;

ret = -ENXIO;
filp->f_op = fops_get(p->ops);
if (!filp->f_op) {
cdev_put(p);
return -ENXIO;
}
if (filp->f_op->open)
if (!filp->f_op)
goto out_cdev_put;

if (filp->f_op->open) {
ret = filp->f_op->open(inode,filp);
if (ret)
cdev_put(p);
if (ret)
goto out_cdev_put;
}

return 0;

out_cdev_put:
cdev_put(p);
return ret;
}

Expand Down

0 comments on commit 8e35784

Please sign in to comment.