[PATCH v3 3/5] drivers: usb: host: efi: add efi io driver

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Aug 24 02:13:18 PDT 2026


Hi,

On 8/20/26 4:34 PM, Fabian Pflug wrote:
> The driver is based on [1] with one "host" controller per device.
> The host controller will hopefully not have any sub-devices and only
> have the one root device, which functions as the only device needed and
> registered for.
> 
> [1] https://uefi.org/specs/UEFI/2.11/17_Protocols_USB_Support.html#usb-driver-model
> 
> Signed-off-by: Fabian Pflug <f.pflug at pengutronix.de>

[snip]

> +	efiret = priv->protocol->get_supported_languages(
> +		priv->protocol, &lang_ids, &table_size);
> +	if (EFI_ERROR(efiret)) {
> +		err = -efi_errno(efiret);
> +		goto out_err;
> +	}
> +
> +	dev->string_langid = lang_ids[0];

Dereference of uninitialized pointer in case that table_size == 0?
usb_alloc_new_device() already zeroes the members, so you want to guard
this behind a table_size >= sizeof(*lang_ids) check.

> +	dev_info(&dev->dev, "Bus %03d Device %03d: ID %04x:%04x %s\n",
> +		 dev->host->busnum, dev->devnum, dev->descriptor->idVendor,
> +		 dev->descriptor->idProduct, dev->prod);

Did you verify that the `usb' command lists all host controllers and the
device under them as one would expect?

> +	// EFI has one device per probe, which now needs its own host controller,
> +	// since there is no shared host controller resource.

Nearly all of the code base uses C89-style comments.
Just something to keep in mind for future submissions.


Cheers,
Ahmad

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |




More information about the barebox mailing list