Re: [PATCH] thermal: k3_j72xx_bandgap: Fix array underflow in prep_lookup_table()

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

 



On Fri, May 20, 2022 at 05:25:56PM +0200, Daniel Lezcano wrote:
> On 20/05/2022 17:02, Dan Carpenter wrote:
> > This while loop exits with "i" set to -1 and so then it sets:
> 
> Won't it exit with 'i' set to '0' ?
> 

Wow.  You made me worried there.  I had to make a test case just to be
sure:

        int i = 10;

        while (i--)
                printf("in %d\n", i);
        printf("out %d\n", i);

Yep.  Ends on on -1.

regards,
dan carpenter




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux