Re: [PATCH v2] kvm: mpic: limit active IRQ sources to NUM_OUTPUTS

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

 



On Wed, Nov 20, 2019 at 04:30:32PM +0530, P J P wrote:
> +-- On Wed, 20 Nov 2019, Paul Mackerras wrote --+
> | Still not right, I'm afraid, since it could leave src->output set to
> | 3, which would lead to an out-of-bounds array access.  I think it
> | needs to be
> 
> ===
> #include <stdio.h>
> 
> int
> main (int argc, char *argv[])
> {   
>     int i = 0;
> 
>     for (i = 0; i < 1024; i++) {
>         printf ("%d: %d\n", i, i % 0x3);
>     }
> 
>     return 0;
> }
> 
> -> https://paste.centos.org/view/fb14b3cf
> ===
> 
> It does not seem to set it to 0x3. When a no is divisible by 0x3, 
> 'src->output' will be set to zero(0).

You're right, I misread the '%' as '&'.

Paul.



[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux