Re: [PATCH u-boot-dm 03/39] regmap: fix a serious pointer casting bug

2021-03-07 Thread Bin Meng
On Sun, Mar 7, 2021 at 12:26 PM Marek BehĂșn wrote: > > There is a serious bug in regmap_read() and regmap_write() functions > where an uint pointer is cast to (void *) which is then cast to (u8 *), > (u16 *), (u32 *) or (u64 *), depending on register width of the map. > > For example given a regma

[PATCH u-boot-dm 03/39] regmap: fix a serious pointer casting bug

2021-03-06 Thread Marek BehĂșn
There is a serious bug in regmap_read() and regmap_write() functions where an uint pointer is cast to (void *) which is then cast to (u8 *), (u16 *), (u32 *) or (u64 *), depending on register width of the map. For example given a regmap with 16-bit register width the code int val = 0x12340