From 827d316dcecff69073cc7d74c8ca4826308f78a8 Mon Sep 17 00:00:00 2001 From: Juha Niskanen Date: Wed, 29 Aug 2018 06:19:19 -0600 Subject: [PATCH] drivers/audio/audio_i2s.c: Fix bad NULL pointer check --- drivers/audio/audio_i2s.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/audio/audio_i2s.c b/drivers/audio/audio_i2s.c index 63a2dc84bb..6e1112e107 100644 --- a/drivers/audio/audio_i2s.c +++ b/drivers/audio/audio_i2s.c @@ -231,11 +231,12 @@ static int audio_i2s_configure(FAR struct audio_lowerhalf_s *dev, #endif { FAR struct audio_i2s_s *audio_i2s = (struct audio_i2s_s *)dev; - FAR struct i2s_dev_s *i2s = audio_i2s->i2s; + FAR struct i2s_dev_s *i2s; int samprate, nchannels, bpsamp; int ret = OK; - DEBUGASSERT(audio_i2s && caps); + DEBUGASSERT(audio_i2s != NULL && caps != NULL); + i2s = audio_i2s->i2s; audinfo("ac_type: %d\n", caps->ac_type); /* Process the configure operation */