RE: [PATCH v3] nvmem: check invalid number of bytes in nvmem_{read,write}()

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

 



Hello Srini,

Thanks for the feedback.

> Subject: Re: [PATCH v3] nvmem: check invalid number of bytes in
> nvmem_{read,write}()
>
>
>
> After applying this patch I get below errors with W=1 C=1
>
> On 11/12/18 09:24, Biju Das wrote:
> > +if (unlikely(check_add_overflow(bytes, offset, &new_bytes)))
> > +return -EOVERFLOW;
> >   drivers/nvmem/core.c:82:13: error: incompatible types in comparison
> expression (different type sizes)
> drivers/nvmem/core.c:82:13: error: incompatible types in comparison
> expression (different type sizes)
> drivers/nvmem/core.c:113:13: error: incompatible types in comparison
> expression (different type sizes)
> drivers/nvmem/core.c:113:13: error: incompatible types in comparison
> expression (different type sizes)

I was trying with arm32 toolchain and compiler happy. Now tried with Arm64 toolchain, it provides a warning and the below typecast fixed the issue.
if (unlikely(check_add_overflow(bytes, (size_t)offset, &new_bytes)))

Does typecasting to (size_t)  fixed the issue in your environment? Please let  me know.

regards,
Biju




[https://www2.renesas.eu/media/email/unicef.jpg]

This Christmas, instead of sending out cards, Renesas Electronics Europe have decided to support Unicef with a donation. For further details click here<https://www.unicef.org/> to find out about the valuable work they do, helping children all over the world.
We would like to take this opportunity to wish you a Merry Christmas and a prosperous New Year.



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux