Skip to content

Commit

Permalink
USB: FHCI: avoid NULL pointer dereference
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexander Beregalov authored and Greg Kroah-Hartman committed Jan 20, 2010
1 parent 04a723e commit ae35fe9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/usb/host/fhci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ae35fe9

Please sign in to comment.