[PATCH] usb: host: xhci-mem: drop useless loop increment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux