fix warning: Dereference of null pointer
This fixes the static analyzer warning
warning: Dereference of null pointer (loaded from variable 'devices')
Bug: None
Test: The warning is gone.
Change-Id: If0d2649bf0a90a403013c4af1b94814357b792c2
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index c6d4fe3..b7b669b 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -1908,7 +1908,7 @@
config->channel_mask,
flags);
- if (*devices == AUDIO_DEVICE_NONE) {
+ if (devices == NULL || *devices == AUDIO_DEVICE_NONE) {
return BAD_VALUE;
}