]> git.baikalelectronics.ru Git - kernel.git/commit
usb: musb: musb_dsps: request_irq() after initializing musb
authorNadezda Lutovinova <lutovinova@ispras.ru>
Thu, 19 Aug 2021 16:33:23 +0000 (19:33 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Aug 2021 11:22:16 +0000 (13:22 +0200)
commit7c75bde329d7e2a93cf86a5c15c61f96f1446cdc
tree60d05a7912ec1d9c817a6b0154f7f4fa7bcdebff
parent1abade64563ef5388db545b55cf158e849f6e717
usb: musb: musb_dsps: request_irq() after initializing musb

If IRQ occurs between calling  dsps_setup_optional_vbus_irq()
and  dsps_create_musb_pdev(), then null pointer dereference occurs
since glue->musb wasn't initialized yet.

The patch puts initializing of neccesery data before registration
of the interrupt handler.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Nadezda Lutovinova <lutovinova@ispras.ru>
Link: https://lore.kernel.org/r/20210819163323.17714-1-lutovinova@ispras.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/musb/musb_dsps.c