Date: Fri, 18 Mar 2016 22:52:11 +0000 (UTC) From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= <dumbbell@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r297046 - stable/10/sys/dev/drm2 Message-ID: <201603182252.u2IMqBPd020294@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dumbbell Date: Fri Mar 18 22:52:11 2016 New Revision: 297046 URL: https://svnweb.freebsd.org/changeset/base/297046 Log: 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 of: r296674 Modified: stable/10/sys/dev/drm2/drm_drv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/drm_drv.c ============================================================================== --- stable/10/sys/dev/drm2/drm_drv.c Fri Mar 18 21:15:04 2016 (r297045) +++ stable/10/sys/dev/drm2/drm_drv.c Fri Mar 18 22:52:11 2016 (r297046) @@ -386,17 +386,21 @@ int drm_ioctl(struct cdev *kdev, u_long 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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201603182252.u2IMqBPd020294>