]> git.baikalelectronics.ru Git - kernel.git/commit
spi: core: Don't destroy master queue if we fail to create it
authorMark Brown <broonie@linaro.org>
Thu, 1 May 2014 17:47:52 +0000 (10:47 -0700)
committerMark Brown <broonie@linaro.org>
Sat, 3 May 2014 16:58:19 +0000 (09:58 -0700)
commit1b4523f89c76d4aef094a0f0642360fa9d7768b5
treed126ddf1fbde696d5f412cafcfcb9b17723e320f
parentd6deb7cbc27d66b4f090cf09c04340a1ffd5340b
spi: core: Don't destroy master queue if we fail to create it

If we fail to create the master queue for some reason we should not attempt
to clean it up since attempting to stop a kthread that was not created will
hang and it's just generally bad practice. Unfortunately at present we call
spi_destroy_queue() even in cases where the creation fails.

Fix this by fixing the error handling in spi_master_initialize_queue() so
that we only flag the master as queued or destroy the queue if creation
succeeded. The change to the flag is done since the general master
cleanup uses this to destroy the queue.

Reported-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
drivers/spi/spi.c