]> 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>
Wed, 22 Sep 2021 10:26:35 +0000 (12:26 +0200)
commitb25d2782ba715c21bb54c508f26a4b5f619408ad
tree704c035e190c3305d745fd8684017b352fba89f6
parent087f68c0843c4637007aafccd47fb51f31505f8a
usb: musb: musb_dsps: request_irq() after initializing musb

[ Upstream commit 7c75bde329d7e2a93cf86a5c15c61f96f1446cdc ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/musb/musb_dsps.c