Message ID | c3695403-b19a-470d-b2b4-80d648ab2c02@omp.ru (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | usb: host: xhci-mem: drop useless loop increment | expand |
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,
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(-)