Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758420AbcLAEsj (ORCPT ); Wed, 30 Nov 2016 23:48:39 -0500 Received: from hqemgate16.nvidia.com ([216.228.121.65]:16071 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756695AbcLAEsh (ORCPT ); Wed, 30 Nov 2016 23:48:37 -0500 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Wed, 30 Nov 2016 08:46:47 -0800 Subject: Re: [PATCH] vfio: Fix handling of error returned by 'vfio_group_get_from_dev()' To: Alex Williamson , Dan Carpenter References: <20161130070612.16073-1-christophe.jaillet@wanadoo.fr> <20161130093646.0c68f7be@t450s.home> <20161130182707.GV6266@mwanda> <20161130113945.2debb209@t450s.home> CC: Christophe JAILLET , , , X-Nvconfidentiality: public From: Kirti Wankhede Message-ID: <7609fb32-7fc1-6b76-2e88-979802a4bad5@nvidia.com> Date: Thu, 1 Dec 2016 10:18:31 +0530 MIME-Version: 1.0 In-Reply-To: <20161130113945.2debb209@t450s.home> X-Originating-IP: [10.24.216.210] X-ClientProxiedBy: BGMAIL101.nvidia.com (10.25.59.10) To bgmail102.nvidia.com (10.25.59.11) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1388 Lines: 45 On 12/1/2016 12:09 AM, Alex Williamson wrote: > On Wed, 30 Nov 2016 21:27:07 +0300 > Dan Carpenter wrote: > >> On Wed, Nov 30, 2016 at 09:36:46AM -0700, Alex Williamson wrote: >>> On Wed, 30 Nov 2016 08:06:12 +0100 >>> Christophe JAILLET wrote: >>> >>>> 'vfio_group_get_from_dev()' seems to return only NULL on error, not an error >>>> pointer. >>>> >>>> Fixes: 2169037dc322 ("vfio iommu: Added pin and unpin callback functions to vfio_iommu_driver_ops") >>>> Fixes: c086de818dd8 ("vfio iommu: Add blocking notifier to notify DMA_UNMAP") >>>> >>>> Signed-off-by: Christophe JAILLET >>>> --- >>> >>> Dan Carpenter proposed a nearly identical patch: >>> >>> http://www.spinics.net/lists/kvm/msg141468.html >>> >>> The difference is you return -ENODEV while Dan returns -EINVAL. I tend >>> to prefer -ENODEV to distinguish this error case versus validation of >>> the other parameters. This patch also identifies both commits >>> introducing these, so I'm inclined to take this one rather than Dan's >>> version. Agree with you Alex. This version looks better. Thanks, Kirti >>> Dan & Kirti, I welcome any credits you'd like to apply to >>> this patch for identifying and reviewing the same issue. Thanks, >>> >> >> Could I get a Reported-by? > > Sure thing, thanks, > > Alex >