mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] USB: FHCI: avoid NULL pointer dereference
@ 2010-01-07  1:17 Alexander Beregalov
  0 siblings, 0 replies; only message in thread
From: Alexander Beregalov @ 2010-01-07  1:17 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Alexander Beregalov

Assign fhci only if usb is not NULL.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
---
 drivers/usb/host/fhci-hcd.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/fhci-hcd.c b/drivers/usb/host/fhci-hcd.c
index 0951818..78e7c3c 100644
--- a/drivers/usb/host/fhci-hcd.c
+++ b/drivers/usb/host/fhci-hcd.c
@@ -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);
-- 
1.6.6


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-01-07  1:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-07  1:17 [PATCH] USB: FHCI: avoid NULL pointer dereference Alexander Beregalov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®