Skip to contentSkip to conversation

usb: host: xhci-mem: drop useless loop increment

PATCH New Sergey Shtylyov 1 participant 1 message Feb 10, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: host: xhci-mem: drop useless loop increment

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.

---
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(-)
drivers/usb/host/xhci-mem.c +1 -1
Index: 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,