diff --git a/drivers/char/misc.c b/drivers/char/misc.c index ffa97d261cf3..205ad4c58470 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c @@ -142,8 +142,8 @@ static int misc_open(struct inode * inode, struct file * file) err = 0; replace_fops(file, new_fops); + file->private_data = c; if (file->f_op->open) { - file->private_data = c; err = file->f_op->open(inode,file); } fail: