From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c7CEw-00019g-1Z for qemu-devel@nongnu.org; Wed, 16 Nov 2016 21:15:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c7CEr-0006BD-2F for qemu-devel@nongnu.org; Wed, 16 Nov 2016 21:15:50 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:42313) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c7CEq-0006Ai-Q7 for qemu-devel@nongnu.org; Wed, 16 Nov 2016 21:15:44 -0500 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uAH2EUMi060172 for ; Wed, 16 Nov 2016 21:15:43 -0500 Received: from e18.ny.us.ibm.com (e18.ny.us.ibm.com [129.33.205.208]) by mx0a-001b2d01.pphosted.com with ESMTP id 26rx0tcsxc-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 16 Nov 2016 21:15:43 -0500 Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 16 Nov 2016 21:15:41 -0500 Date: Thu, 17 Nov 2016 10:15:33 +0800 From: Dong Jia Shi References: <1479329194-10247-1-git-send-email-kwankhede@nvidia.com> <1479329194-10247-13-git-send-email-kwankhede@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1479329194-10247-13-git-send-email-kwankhede@nvidia.com> Message-Id: <20161117021533.GD6620@bjsdjshi@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v14 12/22] vfio: Add notifier callback to parent's ops structure of mdev List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kirti Wankhede Cc: alex.williamson@redhat.com, pbonzini@redhat.com, kraxel@redhat.com, cjia@nvidia.com, qemu-devel@nongnu.org, kvm@vger.kernel.org, kevin.tian@intel.com, jike.song@intel.com, bjsdjshi@linux.vnet.ibm.com, linux-kernel@vger.kernel.org * Kirti Wankhede [2016-11-17 02:16:24 +0530]: Hi Kirti, > diff --git a/drivers/vfio/mdev/vfio_mdev.c b/drivers/vfio/mdev/vfio_mdev.c [...] > @@ -51,6 +78,11 @@ static void vfio_mdev_release(void *device_data) > if (likely(parent->ops->release)) > parent->ops->release(mdev); > > + if (likely(parent->ops->notifier)) { > + if (vfio_unregister_notifier(&mdev->dev, &mdev->nb)) > + pr_err("Failed to unregister notifier for mdev\n"); For the -ENOTTY case, we should not fail here either. > + } > + > module_put(THIS_MODULE); > } > [...] -- Dong Jia