linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] usb: tegra: Fix allocation for the FPCI context
@ 2020-07-12 10:28 Jon Hunter
       [not found] ` <20200712102837.24340-1-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  2020-07-14  9:19 ` [PATCH 1/2] " Thierry Reding
  0 siblings, 2 replies; 8+ messages in thread
From: Jon Hunter @ 2020-07-12 10:28 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Mathias Nyman, Greg Kroah-Hartman, linux-tegra, linux-kernel,
	Jon Hunter, stable

Commit 5c4e8d3781bc ("usb: host: xhci-tegra: Add support for XUSB
context save/restore") is using the IPFS 'num_offsets' value when
allocating memory for FPCI context instead of the FPCI 'num_offsets'.
We have not observed any specific issues because of this, but could
cause too much memory or too little memory to be allocated. Fix this
by using the FPCI 'num_offsets' for allocating the FPCI memory for
storing the FPCI state.

Cc: stable@vger.kernel.org

Fixes: 5c4e8d3781bc ("usb: host: xhci-tegra: Add support for XUSB context save/restore")

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/usb/host/xhci-tegra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
index 9ce28ab47f4b..014d79334f50 100644
--- a/drivers/usb/host/xhci-tegra.c
+++ b/drivers/usb/host/xhci-tegra.c
@@ -856,7 +856,7 @@ static int tegra_xusb_init_context(struct tegra_xusb *tegra)
 	if (!tegra->context.ipfs)
 		return -ENOMEM;
 
-	tegra->context.fpci = devm_kcalloc(tegra->dev, soc->ipfs.num_offsets,
+	tegra->context.fpci = devm_kcalloc(tegra->dev, soc->fpci.num_offsets,
 					   sizeof(u32), GFP_KERNEL);
 	if (!tegra->context.fpci)
 		return -ENOMEM;
-- 
2.17.1

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

end of thread, other threads:[~2020-07-29 10:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-12 10:28 [PATCH 1/2] usb: tegra: Fix allocation for the FPCI context Jon Hunter
     [not found] ` <20200712102837.24340-1-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-07-12 10:28   ` [PATCH 2/2] usb: tegra: Fix zero length memory allocation Jon Hunter
2020-07-14  9:32     ` Thierry Reding
2020-07-15  8:43       ` Jon Hunter
2020-07-15 11:38   ` [PATCH V2] usb: tegra: Fix allocation for the FPCI context Jon Hunter
     [not found]     ` <20200715113842.30680-1-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-07-23 11:19       ` Greg Kroah-Hartman
2020-07-29 10:08         ` Jon Hunter
2020-07-14  9:19 ` [PATCH 1/2] " Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).