[PATCH] firmware: zynqmp-fpga: fix use of uninitialized addr

Sascha Hauer sha at pengutronix.de
Thu Feb 3 02:16:18 PST 2022


On Wed, Feb 02, 2022 at 11:10:54AM +0100, Michael Tretter wrote:
> The bitstream loading API of the firmware is a bit clunky, as the driver
> needs to either pass the size of the bitstream or a pointer to the size
> of the bitstream.
> 
> Commit 2f29ee311f1d ("firmware: zynqmp-fpga: do not use DMA coherent
> memory for bitstream") broke the loading by address, as the pointer to
> the bitstream size was set using the uninitialized DMA address.
> 
> Fix it by determining the argument that is passed to the firmware after
> the bitstream has been mapped and always write the size of the bitstream
> at the end of the passed buffer.
> 
> Signed-off-by: Michael Tretter <m.tretter at pengutronix.de>
> ---
>  drivers/firmware/zynqmp-fpga.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)

Applied, thanks

Sascha


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list