Re: [PATCH] Fix use of uninitialized memory when releasing PCI slots

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/30/2011 08:09 AM, Daniel P. Berrange wrote:
> The 'function' field in the PCI address was not correctly
> initialized, so it was building the wrong address address
> string and so not removing all functions from the in use
> list.
> 
> * src/qemu/qemu_command.c: Fix initialization of PCI function
> ---
>  src/qemu/qemu_command.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 

> +    unsigned int *function = &dev.addr.pci.function;
>  
>      dev.addr.pci.domain = 0;
>      dev.addr.pci.bus = 0;
>      dev.addr.pci.slot = slot;
>  
> -    for (function = 0; function <= QEMU_PCI_ADDRESS_LAST_FUNCTION; function++) {
> +    for (*function = 0; *function <= QEMU_PCI_ADDRESS_LAST_FUNCTION; (*function)++) {
>          addr = qemuPCIAddressAsString(&dev);
>          if (!addr)
>              return -1;
> @@ -950,7 +950,7 @@ int qemuDomainPCIAddressReleaseSlot(qemuDomainPCIAddressSetPtr addrs, int slot)
>  
>          VIR_FREE(addr);
>  
> -        if (qemuDomainPCIAddressReleaseFunction(addrs, slot, function) < 0)
> +        if (qemuDomainPCIAddressReleaseFunction(addrs, slot, *function) < 0)

ACK.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]