Ignore errors returned from kthread_stop since the vimc subdevices should still be notified that streaming stopped so they can release the memory for the streaming, and also kthread should be set to NULL. kthread_stop can return -EINTR in case the thread did not yet run. This can happen if userspace calls streamon and streamoff right after. Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@xxxxxxxxxxxxx> --- changes since v2: add a comment explaning why we ignore the error drivers/media/platform/vimc/vimc-streamer.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/vimc/vimc-streamer.c b/drivers/media/platform/vimc/vimc-streamer.c index cd6b55433c9e..6a6fa6c21138 100644 --- a/drivers/media/platform/vimc/vimc-streamer.c +++ b/drivers/media/platform/vimc/vimc-streamer.c @@ -215,9 +215,13 @@ int vimc_streamer_s_stream(struct vimc_stream *stream, return 0; ret = kthread_stop(stream->kthread); - if (ret) - return ret; + /* + * ignore errors from kthread_stop since we have to set kthread + * to NULL and notify the subdevs that the stream stopped anyway + */ + if (ret) + dev_warn(ved->dev, "kthread_stop returned '%d'\n", ret); stream->kthread = NULL; vimc_streamer_pipeline_terminate(stream); -- 2.17.1