Skip to content

Commit a75e2d6

Browse files
Colin Ian Kinggregkh
authored andcommitted
xhci: Fix sizeof() mismatch
An incorrect sizeof() is being used, sizeof(rhub->ports) is not correct, it should be sizeof(*rhub->ports). This bug did not cause any issues because it just so happens the sizes are the same. Fixes: bcaa9d5 ("xhci: Create new structures to store xhci port information") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20201028203124.375344-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent befa1c2 commit a75e2d6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/usb/host/xhci-mem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2252,8 +2252,8 @@ static void xhci_create_rhub_port_array(struct xhci_hcd *xhci,
22522252

22532253
if (!rhub->num_ports)
22542254
return;
2255-
rhub->ports = kcalloc_node(rhub->num_ports, sizeof(rhub->ports), flags,
2256-
dev_to_node(dev));
2255+
rhub->ports = kcalloc_node(rhub->num_ports, sizeof(*rhub->ports),
2256+
flags, dev_to_node(dev));
22572257
for (i = 0; i < HCS_MAX_PORTS(xhci->hcs_params1); i++) {
22582258
if (xhci->hw_ports[i].rhub != rhub ||
22592259
xhci->hw_ports[i].hcd_portnum == DUPLICATE_ENTRY)

0 commit comments

Comments
 (0)