Re: [PATCH] xhci: Fix bcdUSB initialization

From: Dan Carpenter
Date: Thu Feb 27 2025 - 15:15:57 EST


On Fri, Feb 28, 2025 at 01:04:00AM +0530, Abhishek Tamboli wrote:
> Initialize bcdUSB to 0 to prevent undefined behaviour
> if accessed without being explicitly set.
>
> Fix the following smatch error:
> drivers/usb/host/xhci-hub.c:71 xhci_create_usb3x_bos_desc()
> error: uninitialized symbol 'bcdUSB'
>
> Signed-off-by: Abhishek Tamboli <abhishektamboli9@xxxxxxxxx>
> ---

The concern here would be that xhci->num_port_caps is <= 0. That's
probably not possible so it's likely a false positive.

regards,
dan carpenter