diff --git a/drivers/char/misc.c b/drivers/char/misc.c index ffa97d261cf3322615bc403931d99c71d1896a50..205ad4c584708257578d519e895b6be3a52bbe89 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: