[PATCH 3/4] usb: ohci-at91: Add `ohci_t` field in `ohci_at91_priv`

Marek Vasut marex at denx.de
Tue Jan 3 00:27:33 CET 2023


On 12/23/22 13:34, Sergiu Moga wrote:
> From: Cristian Birsan <cristian.birsan at microchip.com>
> 
> The `ohci_register` function expects that the OHCI driver's
> priv is a struct whose first field is of type `ohci_t`.
> The original conversion to DM did not have it and this
> inconsistency revealed itself whenever U-Boot required
> multiple memory allocations resulting in a memory overwrite
> of where this field would supposedly be.
> 
> Thus, add this missing field and automatically increase
> the implicit size of the driver's priv to avoid whatever
> future memory allocations may take place from overwriting
> it.
> 
> Fixes: de1cf0a9c6 ("drivers: usb: ohci-at91: Enable OHCI functionality and register into DM")
> Signed-off-by: Cristian Birsan <cristian.birsan at microchip.com>
> Signed-off-by: Sergiu Moga <sergiu.moga at microchip.com>
> Tested-by: Mihai Sain <mihai.sain at microchip.com>

Either squash into 2/4 or -- if this should be applied on current 
release -- submit as separate patch.


More information about the U-Boot mailing list