All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: host: xhci-mem: drop useless loop increment
@ 2022-02-10 11:59 Sergey Shtylyov
  0 siblings, 0 replies; only message in thread
From: Sergey Shtylyov @ 2022-02-10 11:59 UTC (permalink / raw)
  To: Mathias Nyman, linux-usb, Greg Kroah-Hartman

The 'tt_info' local variable is assigned to a result of kzalloc_node() call
in the body of the *for* loop in xhci_alloc_tt_info() and then incremented
after that body is executed for no apparent reason -- drop that increment.

Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

---
This patch is against the 'usb-next' branch of Greg KH's 'usb.git' repo.

 drivers/usb/host/xhci-mem.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: usb/drivers/usb/host/xhci-mem.c
===================================================================
--- usb.orig/drivers/usb/host/xhci-mem.c
+++ usb/drivers/usb/host/xhci-mem.c
@@ -836,7 +836,7 @@ int xhci_alloc_tt_info(struct xhci_hcd *
 	else
 		num_ports = hdev->maxchild;
 
-	for (i = 0; i < num_ports; i++, tt_info++) {
+	for (i = 0; i < num_ports; i++) {
 		struct xhci_interval_bw_table *bw_table;
 
 		tt_info = kzalloc_node(sizeof(*tt_info), mem_flags,

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-10 11:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-10 11:59 [PATCH] usb: host: xhci-mem: drop useless loop increment Sergey Shtylyov

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.