set file private data to zero during allocation

The net result is the same and it makes more clear some problems with
freeing this memory (addressed in a later patch)

Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
fix memleak avalanche when system is low on memory

If one of kzalloc(todo_list_item) fail, filp->private_data remains
garbage and cryptodev_release will fail during free. To fix that,
filp->private_data is set early so that at release, there will be
knowledge about allocated memory.

Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
fix typo in test condition for error exits

Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
destroy mutexes in reverse order of their initialization

- for completion destroy also &pcr->fcrypt_sem and session mutexes
  during shutdown

Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>