From owner-svn-src-stable@freebsd.org Fri Mar 18 22:52:12 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 852A6AD4405; Fri, 18 Mar 2016 22:52:12 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 519E61168; Fri, 18 Mar 2016 22:52:12 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2IMqBka020295; Fri, 18 Mar 2016 22:52:11 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IMqBPd020294; Fri, 18 Mar 2016 22:52:11 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201603182252.u2IMqBPd020294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Fri, 18 Mar 2016 22:52:11 +0000 (UTC) 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 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 22:52:12 -0000 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; }