mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
drm: Fix dev->ioctl_count references leak
This fixes the following error: kernel: error: [drm:pid1167:drm_release] *ERROR* Device busy: 2 Because of that, drm_lastclose() was not called, leading to a few memory leaks once the driver was unloaded. MFC after: 1 week
This commit is contained in:
parent
b8eb229d6f
commit
85cfd0daea
1 changed files with 4 additions and 0 deletions
|
|
@ -386,17 +386,21 @@ int drm_ioctl(struct cdev *kdev, u_long cmd, caddr_t data, int flags,
|
|||
switch (cmd) {
|
||||
case FIONBIO:
|
||||
case FIOASYNC:
|
||||
atomic_dec(&dev->ioctl_count);
|
||||
return 0;
|
||||
|
||||
case FIOSETOWN:
|
||||
atomic_dec(&dev->ioctl_count);
|
||||
return fsetown(*(int *)data, &file_priv->minor->buf_sigio);
|
||||
|
||||
case FIOGETOWN:
|
||||
atomic_dec(&dev->ioctl_count);
|
||||
*(int *) data = fgetown(&file_priv->minor->buf_sigio);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (IOCGROUP(cmd) != DRM_IOCTL_BASE) {
|
||||
atomic_dec(&dev->ioctl_count);
|
||||
DRM_DEBUG("Bad ioctl group 0x%x\n", (int)IOCGROUP(cmd));
|
||||
return EINVAL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue