All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] pci_ep: fix wrong addressing to barno
@ 2019-07-15 20:04 Ramon Fried
  2019-07-19  0:00 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Ramon Fried @ 2019-07-15 20:04 UTC (permalink / raw)
  To: u-boot

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 <rfried.dev@gmail.com>
---
 drivers/pci_endpoint/sandbox-pci_ep.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/pci_endpoint/sandbox-pci_ep.c b/drivers/pci_endpoint/sandbox-pci_ep.c
index 0258433d8f..ca8871fc36 100644
--- a/drivers/pci_endpoint/sandbox-pci_ep.c
+++ b/drivers/pci_endpoint/sandbox-pci_ep.c
@@ -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;
 }
-- 
2.22.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH] pci_ep: fix wrong addressing to barno
  2019-07-15 20:04 [U-Boot] [PATCH] pci_ep: fix wrong addressing to barno Ramon Fried
@ 2019-07-19  0:00 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2019-07-19  0:00 UTC (permalink / raw)
  To: u-boot

On Mon, Jul 15, 2019 at 11:04:41PM +0300, Ramon Fried wrote:

> 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 <rfried.dev@gmail.com>

Applied to u-boot/master, thanks!

-- 
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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-19  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-15 20:04 [U-Boot] [PATCH] pci_ep: fix wrong addressing to barno Ramon Fried
2019-07-19  0:00 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.