diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/drm_fops.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index 3733e36d135e..b06a53715853 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c | |||
@@ -183,6 +183,10 @@ int drm_stub_open(struct inode *inode, struct file *filp) | |||
183 | 183 | ||
184 | old_fops = filp->f_op; | 184 | old_fops = filp->f_op; |
185 | filp->f_op = fops_get(&dev->driver->fops); | 185 | filp->f_op = fops_get(&dev->driver->fops); |
186 | if (filp->f_op == NULL) { | ||
187 | filp->f_op = old_fops; | ||
188 | goto out; | ||
189 | } | ||
186 | if (filp->f_op->open && (err = filp->f_op->open(inode, filp))) { | 190 | if (filp->f_op->open && (err = filp->f_op->open(inode, filp))) { |
187 | fops_put(filp->f_op); | 191 | fops_put(filp->f_op); |
188 | filp->f_op = fops_get(old_fops); | 192 | filp->f_op = fops_get(old_fops); |