angler-fishThe Vulnerability History Project

iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAltPMNgTHGJyb29uaWVA

      a2VybmVsLm9yZwAKCRAk1otyXVSH0EbIB/9/GqX1uauuSqrAkgRBc6lwdcQShbz1
 Y7d1XiFvph9XDJgVbrkwYvOCpyjqJp9ZiqzYE8JjMvdXSKoFDNJz+xPtvZvhjnsa
 r+UgnxJwXNNrZ+7PUBo3qvV71tTY3BdijdBdP4zIoNk+G0bEFvG9Cmz8BSmrgzFu
 yNAVVjWi2ZCEFMwE2pt3nh6O/TTZKZNQlHBo44iY5icX83hnEReSae+srZHaDNxe
 YZcWUjWjF1KZo0Z8NIp2hNskayk0fyuD359v5FDz/tT/Ffo4FrD1B2bZNBFXwe0w
 UBJauNRzy0j1xukFvSbdsNl4Y+E4D+UsO8xKpoyYdW/7VZoNy90vG6Jg
 =N3WI
 -----END PGP SIGNATURE-----

spi: dw: fix possible race condition

It is possible to get an interrupt as soon as it is requested.  dw_spi_irq
does spi_controller_get_devdata(master) and expects it to be different than
NULL. However, spi_controller_set_devdata() is called after request_irq(),
resulting in the following crash:

CPU 0 Unable to handle kernel paging request at virtual address 00000030, epc == 8058e09c, ra == 8018ff90
[...]
Call Trace:
[<8058e09c>] dw_spi_irq+0x8/0x64
[<8018ff90>] __handle_irq_event_percpu+0x70/0x1d4
[<80
    
commit 66b19d762378785d1568b5650935205edfeb0503
+2 -1
expand_less