Skip to content

Commit 4819fef

Browse files
evansm7Sarah Sharp
authored andcommitted
xhci: Bigendian fix for xhci_check_bandwidth()
Commit 834cb0f "xhci: Fix memory leak bug when dropping endpoints" added a small endian bug. This patch fixes xhci_check_bandwidth() to read add/drop_flags LE. Signed-off-by: Matt Evans <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
1 parent f697531 commit 4819fef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/host/xhci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,8 +1849,8 @@ int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
18491849

18501850
/* Free any rings that were dropped, but not changed. */
18511851
for (i = 1; i < 31; ++i) {
1852-
if ((ctrl_ctx->drop_flags & (1 << (i + 1))) &&
1853-
!(ctrl_ctx->add_flags & (1 << (i + 1))))
1852+
if ((le32_to_cpu(ctrl_ctx->drop_flags) & (1 << (i + 1))) &&
1853+
!(le32_to_cpu(ctrl_ctx->add_flags) & (1 << (i + 1))))
18541854
xhci_free_or_cache_endpoint_ring(xhci, virt_dev, i);
18551855
}
18561856
xhci_zero_in_ctx(xhci, virt_dev);

0 commit comments

Comments
 (0)