]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commita1b682163c068ba205464ec8a59a07ea5fc48000
treeab30ddee7658437f0322cd4c9194105b6e79fad5
parente371ccd08fb14e9a8871d1e88f196b09d880cad5
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: e1869556375 ("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