USB: host: ohci-at91: fix a crash in ohci_hcd_at91_overcurrent_irq
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>
Wed, 2 Dec 2015 19:36:55 +0000 (20:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Jan 2016 04:55:42 +0000 (20:55 -0800)
commit1b2702092f5b4b43f82126835b62d7f010c4caaa
tree1d3b395f406e7818be9e34d08fa41efaa9421e2a
parent32750c485a612b133b9a447ca6e006801ae8d68d
USB: host: ohci-at91: fix a crash in ohci_hcd_at91_overcurrent_irq

commit 4a0c4c36094cefd85cbe489590382ef69516ccef upstream.

The interrupt handler, ohci_hcd_at91_overcurrent_irq may be called right
after registration. At that time, pdev->dev.platform_data is not yet set,
leading to a NULL pointer dereference.

Fixes: e4df92279fd9 (USB: host: ohci-at91: merge loops in ohci_hcd_at91_drv_probe)
Reported-by: Peter Rosin <peda@axentia.se>
Tested-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ohci-at91.c