Re: [PATCH 2/3] S390: Add virtio hotplug add support

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

 



On Wed, Aug 25, 2010 at 10:20:03AM +0200, Alexander Graf wrote:
> On 25.08.2010, at 10:16, Heiko Carstens wrote:
> > On Tue, Aug 24, 2010 at 03:48:51PM +0200, Alexander Graf wrote:
> >> +static void hotplug_devices(struct work_struct *dummy)
> >> +{
> >> +	unsigned int i;
> >> +	struct kvm_device_desc *d;
> >> +	struct device *dev;
> >> +
> >> +	for (i = 0; i < PAGE_SIZE; i += desc_size(d)) {
> > 
> > This should be 
> > 
> > 	for (i = 0; i + desc_size(d) <= PAGE_SIZE; i += desc_size(d)) {
> > 
> > otherwise you might have memory accesses beyond the device page...
> 
> Oh, this is a simple copy&paste from the original search method.
> Is d valid in the first part of the loop already?

No, you would need to initialize it with kvm_devices if you change
the loop.
_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/virtualization


[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux