CRAS: check ucm manager exists before noise cancellation functions

The variable ucm could be NULL for alsa_io if there is no UCM config for
the device. We should check if it exists before usage, e.g. the noise
cancellation set/check which we recently added.

BUG=b:181329545
TEST=Check USB Headset play/record is worked on Caroline

Change-Id: I3c46615902ca8e074a74b7bc03da36b85c035f69
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/2728905
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Yu-Hsuan Hsu <yuhsuan@chromium.org>
Commit-Queue: Pin-chih Lin <johnylin@chromium.org>
Tested-by: Pin-chih Lin <johnylin@chromium.org>
Auto-Submit: Pin-chih Lin <johnylin@chromium.org>
1 file changed