mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
USB: wusb: correctly check size of security descriptor.
Reported-by: Roel Kluin <[email protected]> Signed-off-by: David Vrabel <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
2e9729d0f8
commit
9279095a9e
1 changed files with 3 additions and 3 deletions
|
|
@ -205,15 +205,15 @@ int wusb_dev_sec_add(struct wusbhc *wusbhc,
|
|||
const void *itr, *top;
|
||||
char buf[64];
|
||||
|
||||
secd = kmalloc(sizeof(struct usb_security_descriptor), GFP_KERNEL);
|
||||
secd = kmalloc(sizeof(*secd), GFP_KERNEL);
|
||||
if (secd == NULL) {
|
||||
result = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
result = usb_get_descriptor(usb_dev, USB_DT_SECURITY,
|
||||
0, secd, sizeof(struct usb_security_descriptor));
|
||||
if (result < sizeof(secd)) {
|
||||
0, secd, sizeof(*secd));
|
||||
if (result < sizeof(*secd)) {
|
||||
dev_err(dev, "Can't read security descriptor or "
|
||||
"not enough data: %d\n", result);
|
||||
goto out;
|
||||
|
|
|
|||
Loading…
Reference in a new issue