]> git.ipfire.org Git - thirdparty/kernel/stable.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 09:45:31 +0000 (11:45 +0200)
commit5269937d1483d3159d5b51907346e4f4b13ef079
tree37c27ad9f514ea67f60fa69b131c0b64ef7ccdbc
parentb48af86a9c8e9ee9f2dc48678ecf767b5f13997b
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