CRAS: bt_io: validate profile device pointer before using them

Return -EINVAL if found NULL pointer.

BUG=b:115952443
TEST=FEATURES=test USE=ubsan emerge-nautilus adhd &&
FEATURES=test USE=asan emerge-nautilus adhd

CQ-DEPEND=CL:I6fcfde73464683fbc7164d7af7f487cc09372f66
Change-Id: I473a15b680452a66a8e608ad9a37806c177935e9
Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1502812
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
1 file changed