USB: FHCI: avoid NULL pointer dereference
Assign fhci only if usb is not NULL. Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
04a723ea9c
commit
ae35fe9e8a
1 changed files with 2 additions and 1 deletions
|
@ -242,9 +242,10 @@ static int fhci_mem_init(struct fhci_hcd *fhci)
|
|||
static void fhci_usb_free(void *lld)
|
||||
{
|
||||
struct fhci_usb *usb = lld;
|
||||
struct fhci_hcd *fhci = usb->fhci;
|
||||
struct fhci_hcd *fhci;
|
||||
|
||||
if (usb) {
|
||||
fhci = usb->fhci;
|
||||
fhci_config_transceiver(fhci, FHCI_PORT_POWER_OFF);
|
||||
fhci_ep0_free(usb);
|
||||
kfree(usb->actual_frame);
|
||||
|
|
Loading…
Add table
Reference in a new issue