From: Ian Jackson Subject: Re: [PATCH] libxl: do not try to detach pci device when none attached Date: Tue, 21 Jun 2011 17:34:30 +0100 Message-ID: <19968.51222.425730.178258@mariner.uk.xensource.com> References: <88f67b423c89f4bd6048.1307662408@devel14> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Stefano Stabellini Cc: "xen-devel@lists.xensource.com" , Marek Marczykowski List-Id: xen-devel@lists.xenproject.org Stefano Stabellini writes ("Re: [Xen-devel] [PATCH] libxl: do not try to detach pci device when none attached"): > diff -r 37c77bacb52a tools/libxl/libxl_pci.c > --- a/tools/libxl/libxl_pci.c Mon May 23 17:38:28 2011 +0100 > +++ b/tools/libxl/libxl_pci.c Fri Jun 10 10:39:05 2011 +0000 > @@ -1022,8 +1022,7 @@ int libxl_device_pci_list_assigned(libxl > } while ((p = strtok_r(NULL, ",=", &saveptr)) != NULL); > } > } > - if ( *num ) > - *list = pcidevs; > + *list = pcidevs; This patch looks correct to me, as far as it goes. If n==0 then calloc is passed 0 and may return 0 willy-nilly but since there's no error check this doesn't cause other trouble :-/. Ian.