Commit ae35fe9e authored by Alexander Beregalov's avatar Alexander Beregalov Committed by Greg Kroah-Hartman

USB: FHCI: avoid NULL pointer dereference

Assign fhci only if usb is not NULL.
Signed-off-by: default avatarAlexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 04a723ea
...@@ -242,9 +242,10 @@ err: ...@@ -242,9 +242,10 @@ err:
static void fhci_usb_free(void *lld) static void fhci_usb_free(void *lld)
{ {
struct fhci_usb *usb = lld; struct fhci_usb *usb = lld;
struct fhci_hcd *fhci = usb->fhci; struct fhci_hcd *fhci;
if (usb) { if (usb) {
fhci = usb->fhci;
fhci_config_transceiver(fhci, FHCI_PORT_POWER_OFF); fhci_config_transceiver(fhci, FHCI_PORT_POWER_OFF);
fhci_ep0_free(usb); fhci_ep0_free(usb);
kfree(usb->actual_frame); kfree(usb->actual_frame);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment