Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753735AbcK3S1k (ORCPT ); Wed, 30 Nov 2016 13:27:40 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:47816 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757447AbcK3S12 (ORCPT ); Wed, 30 Nov 2016 13:27:28 -0500 Date: Wed, 30 Nov 2016 21:27:07 +0300 From: Dan Carpenter To: Alex Williamson Cc: Christophe JAILLET , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Kirti Wankhede Subject: Re: [PATCH] vfio: Fix handling of error returned by 'vfio_group_get_from_dev()' Message-ID: <20161130182707.GV6266@mwanda> References: <20161130070612.16073-1-christophe.jaillet@wanadoo.fr> <20161130093646.0c68f7be@t450s.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161130093646.0c68f7be@t450s.home> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1118 Lines: 29 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. 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? thanks, dan carpenter