criu: pstree_switch_state -- Fix nil deref on error path

We may enter with @root_item = NULL in case of error
handling, so simply bail out.

Signed-off-by: Cyrill Gorcunov <gorcunov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Cyrill Gorcunov 2016-03-16 11:52:00 +03:00 committed by Pavel Emelyanov
parent 66ccd9a932
commit 1fc5c0244b

View file

@ -463,6 +463,9 @@ void pstree_switch_state(struct pstree_item *root_item, int st)
{
struct pstree_item *item = root_item;
if (!root_item)
return;
if (st != TASK_DEAD)
freezer_restore_state();