pci_ep: fix wrong addressing to barno
PATCH 1/1 pci_ep: fix wrong addressing to barno
barno was mistakely readed from the target structure, resulting in undefined behavious depending on the previous memory content. fix that.
Fixes bb413337826e ("pci_ep: add pci endpoint sandbox driver")
Signed-off-by Ramon Fried <[email protected]>
--- drivers/pci_endpoint/sandbox-pci_ep.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/pci_endpoint/sandbox-pci_ep.c +1 -3
@@ -88,9 +88,7 @@ static int sandbox_read_bar(struct udevice *dev, uint fn,if (fn >0 )return -ENODEV ; - bar_idx = ep_bar->barno; - -memcpy (ep_bar, &priv->bars[bar_idx],sizeof (*ep_bar)); +memcpy (ep_bar, &priv->bars[barno],sizeof (*ep_bar));return 0 ; }
Signature · 1 line
2.22.0
PATCH 1/1 pci_ep: fix wrong addressing to barno
Quoted 7 lines · Ramon Fried
barno was mistakely readed from the target structure, resulting in undefined behavious depending on the previous memory content. fix that.
Fixes bb413337826e ("pci_ep: add pci endpoint sandbox driver")Signed-off-by Ramon Fried <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190718/7e8a52b3/attachment.sig>