spi: orion: set devdata properly as it is being used later
authorMuhammad Usama Anjum <musamaanjum@gmail.com>
Thu, 8 Apr 2021 19:57:18 +0000 (00:57 +0500)
committerMark Brown <broonie@kernel.org>
Fri, 9 Apr 2021 12:44:02 +0000 (13:44 +0100)
commite980048263ba72dcdbbf45d59e84c02001340f75
treeab30ddee7658437f0322cd4c9194105b6e79fad5
parent4df2f5e1372e9eec8f9e1b4a3025b9be23487d36
spi: orion: set devdata properly as it is being used later

If device_get_match_data returns NULL, devdata isn't being updated
properly. It is being used later in the function. Both devdata and
spi->devdata should be updated to avoid NULL pointer dereference.

Addresses-Coverity: ("NULL pointer dereference")
Fixes: 0e6521f13c2 ("spi: orion: Use device_get_match_data() helper")
Signed-off-by: Muhammad Usama Anjum <musamaanjum@gmail.com>
Link: https://lore.kernel.org/r/20210408195718.GA3075166@LEGION
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-orion.c