Commit dc42ced1 authored by Mark Brown's avatar Mark Brown Committed by Neena Busireddy
Browse files

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: default avatarRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
(cherry picked from commit c3676d5c)
(cherry picked from commit 849521899b7906b6c4e2894b82a730d08e9bbbe8)
parent d668c6b0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment