[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 2 of 2] libxl_pci: verify device is assignable before adding to domain
Ian Jackson writes ("Re: [Xen-devel] [PATCH 2 of 2] libxl_pci: verify device is assignable before adding to domain"): > Doug Magee writes ("[PATCH 2 of 2] libxl_pci: verify device is assignable > before adding to domain"): > > Previously, libxl__device_pci_add only checked the device to be added > > against > > the list of currently assigned devices. This patch changes the behavior to > > check that the device to be assigned is in the list of assignable devices, > > which only includes those owned by pciback and not assigned to another > > domain. > ... > > + libxl_device_pci *assignable; > > + int num_assignable, i, rc; > ... > > + assignable = libxl_device_pci_list_assignable(ctx, &num_assignable); > > + > > What about failure ? libxl_device_pci_list_assignable might return > NULL on failure, I think. So you need to add a check for that. Yes. > And in that case it won't assign to num_assignable either, leading to > an uninitialised variable use and possible crash in out. I think you > should initialise assignable and num_assignable to 0 to avoid this. Yes. Thanks, Ian. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |