ASoC: Intel: Fix pcm stream context restore crash
ASoC: Intel: Fix pcm stream context restore crash

In some cases the pcm stream is closed while context has been
scheduled to be restored, causing a null pointer deref panic.
Cancel work to ensure stream does not get freed while work is
still active/pending.

Also, restoring the pcm context can be safely skipped after the
stream has been stopped. Check if pcm stream is still running
before restoring stream context to help pending work finish
more quickly in stream close path.

Signed-off-by: Kevin Strasser <6de8fd4fdea896c0ed51709b02692888255d2cbc@intel.com>
Signed-off-by: Jarkko Nikula <ed47dfa4cd43d03d92ccc66ffdb9609c96fcf22b@linux.intel.com>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@linaro.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs