Skip to contentSkip to conversation

USB: FHCI: avoid NULL pointer dereference

PATCH New Alexander Beregalov 1 participant 1 message Jan 7, 2010 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB: FHCI: avoid NULL pointer dereference

Assign fhci only if usb is not NULL.

---
 drivers/usb/host/fhci-hcd.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/usb/host/fhci-hcd.c +2 -1
index 0951818..78e7c3c 100644
@@ -242,9 +242,10 @@ err:
 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);
Signature · 1 line
1.6.6