diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-09-22 14:17:15 -0400 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 11:52:07 +0900 |
commit | f686291040f05ed23d74cc71910223426888d81b (patch) | |
tree | 8b3b2edfceb3b75637d6cd29d32c853082fddf27 /fs/char_dev.c | |
parent | f0ecf5e5d0c47607a01a43e7dd7ffb649e3e5ec4 (diff) | |
download | linux-3.10-f686291040f05ed23d74cc71910223426888d81b.tar.gz linux-3.10-f686291040f05ed23d74cc71910223426888d81b.tar.bz2 linux-3.10-f686291040f05ed23d74cc71910223426888d81b.zip |
upstream: consolidate the reassignments of ->f_op in ->open() instances
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/char_dev.c')
-rw-r--r-- | fs/char_dev.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/char_dev.c b/fs/char_dev.c index afc2bb69178..94b5f60076d 100644 --- a/fs/char_dev.c +++ b/fs/char_dev.c @@ -368,6 +368,7 @@ void cdev_put(struct cdev *p) */ static int chrdev_open(struct inode *inode, struct file *filp) { + const struct file_operations *fops; struct cdev *p; struct cdev *new = NULL; int ret = 0; @@ -400,10 +401,11 @@ static int chrdev_open(struct inode *inode, struct file *filp) return ret; ret = -ENXIO; - filp->f_op = fops_get(p->ops); - if (!filp->f_op) + fops = fops_get(p->ops); + if (!fops) goto out_cdev_put; + replace_fops(filp, fops); if (filp->f_op->open) { ret = filp->f_op->open(inode, filp); if (ret) |