mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-24 15:56:41 +00:00
usb: fix for unconfigured usb devices
Avoids null pointer in usb raw.
This commit is contained in:
parent
c72d1655f4
commit
d409b0e98b
@ -634,8 +634,12 @@ class Usb::Session_component : public Session_rpc_object,
|
|||||||
void config_descriptor(Device_descriptor *device_descr,
|
void config_descriptor(Device_descriptor *device_descr,
|
||||||
Config_descriptor *config_descr) override
|
Config_descriptor *config_descr) override
|
||||||
{
|
{
|
||||||
Genode::memcpy(device_descr, &_device->udev->descriptor, sizeof(usb_device_descriptor));
|
Genode::memcpy(device_descr, &_device->udev->descriptor, sizeof(usb_device_descriptor));
|
||||||
Genode::memcpy(config_descr, &_device->udev->actconfig->desc, sizeof(usb_config_descriptor));
|
|
||||||
|
if (_device->udev->actconfig)
|
||||||
|
Genode::memcpy(config_descr, &_device->udev->actconfig->desc, sizeof(usb_config_descriptor));
|
||||||
|
else
|
||||||
|
Genode::memset(config_descr, 0, sizeof(usb_config_descriptor));
|
||||||
|
|
||||||
device_descr->bus = _device->udev->bus->busnum;
|
device_descr->bus = _device->udev->bus->busnum;
|
||||||
device_descr->num = _device->udev->devnum;
|
device_descr->num = _device->udev->devnum;
|
||||||
|
Loading…
Reference in New Issue
Block a user