drivers/audio: fix some bad NULL checks
@@ -861,6 +861,8 @@ static int null_enqueuebuffer(FAR struct audio_lowerhalf_s *dev, FAR struct ap_b
FAR struct null_dev_s *priv = (FAR struct null_dev_s *)dev;
bool done;
+ DEBUGASSERT(priv && apb && priv->dev.upper);
+
audvdbg("apb=%p curbyte=%d nbytes=%d nmaxbytes %d\n", apb, apb->curbyte, apb->nbytes, apb->nmaxbytes);
/* Say that we consumed all of the data */
@@ -870,10 +872,6 @@ static int null_enqueuebuffer(FAR struct audio_lowerhalf_s *dev, FAR struct ap_b
/* Check if this was the last buffer in the stream */
done = ((apb->flags & AUDIO_APB_FINAL) != 0);
- /* And return the buffer to the upper level */
-
- DEBUGASSERT(priv && apb && priv->dev.upper);
-
priv->frames++;
/* The buffer belongs to to an upper level. Just forward the event to
