mirror of
https://xff.cz/git/u-boot/
synced 2025-09-29 14:31:16 +02:00
usb: gadget: composite: fix NULL pointer when a non standard request is received
In case usb configuration is unknown (cdev->config == NULL), non standard request should not be processed. Remove also the cdev->config check below which will never happen. This issue was seen using ums feature. Signed-off-by: Christophe Kerello <christophe.kerello@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
This commit is contained in:
committed by
Marek Vasut
parent
003659bda9
commit
d57ed4d9f2
@@ -838,6 +838,9 @@ unknown:
|
|||||||
ctrl->bRequestType, ctrl->bRequest,
|
ctrl->bRequestType, ctrl->bRequest,
|
||||||
w_value, w_index, w_length);
|
w_value, w_index, w_length);
|
||||||
|
|
||||||
|
if (!cdev->config)
|
||||||
|
goto done;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* functions always handle their interfaces and endpoints...
|
* functions always handle their interfaces and endpoints...
|
||||||
* punt other recipients (other, WUSB, ...) to the current
|
* punt other recipients (other, WUSB, ...) to the current
|
||||||
@@ -882,7 +885,7 @@ unknown:
|
|||||||
value = f->setup(f, ctrl);
|
value = f->setup(f, ctrl);
|
||||||
else {
|
else {
|
||||||
c = cdev->config;
|
c = cdev->config;
|
||||||
if (c && c->setup)
|
if (c->setup)
|
||||||
value = c->setup(c, ctrl);
|
value = c->setup(c, ctrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user