Don't try to stop non running thread

If _cas_create_thread() thread failed, queue should be stopped by ocf. One of steps
done during queue stop is stopping kernel thread.

To avoid stopping thread which is not running, additional check was added in
_cas_stop_thread().

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk 2020-03-07 15:22:30 -05:00
parent 3eab28cf44
commit e39eecab49

View File

@ -207,7 +207,7 @@ static void _cas_start_thread(struct cas_thread_info *info)
static void _cas_stop_thread(struct cas_thread_info *info) static void _cas_stop_thread(struct cas_thread_info *info)
{ {
if (info->running && info->thread) { if (info && info->running && info->thread) {
reinit_completion(&info->compl); reinit_completion(&info->compl);
atomic_set(&info->stop, 1); atomic_set(&info->stop, 1);
wake_up(&info->wq); wake_up(&info->wq);