summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2012-09-03 09:25:16 +0000
committermalc <av1474@comtv.ru>2012-09-23 01:34:16 +0400
commit93b6599734f81328ee3d608f57667742cafeea72 (patch)
tree1ef2c32898eae56c16c6b88c0d4fbd99f490a487 /audio
parent04cbbdeefdda2615b11f7890f1e61b750e83129f (diff)
downloadqemu-93b6599734f81328ee3d608f57667742cafeea72.tar.gz
qemu-93b6599734f81328ee3d608f57667742cafeea72.tar.bz2
qemu-93b6599734f81328ee3d608f57667742cafeea72.zip
audio: Fix warning from static code analysis
smatch report: audio/audio_template.h:416 AUD_open_out(18) warn: variable dereferenced before check 'as' (see line 414) Moving the ldebug statement after the statement which checks 'as' fixes that warning. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: malc <av1474@comtv.ru>
Diffstat (limited to 'audio')
-rw-r--r--audio/audio_template.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/audio/audio_template.h b/audio/audio_template.h
index 519432a7c5..16f7880770 100644
--- a/audio/audio_template.h
+++ b/audio/audio_template.h
@@ -410,15 +410,15 @@ SW *glue (AUD_open_, TYPE) (
SW *old_sw = NULL;
#endif
- ldebug ("open %s, freq %d, nchannels %d, fmt %d\n",
- name, as->freq, as->nchannels, as->fmt);
-
if (audio_bug (AUDIO_FUNC, !card || !name || !callback_fn || !as)) {
dolog ("card=%p name=%p callback_fn=%p as=%p\n",
card, name, callback_fn, as);
goto fail;
}
+ ldebug ("open %s, freq %d, nchannels %d, fmt %d\n",
+ name, as->freq, as->nchannels, as->fmt);
+
if (audio_bug (AUDIO_FUNC, audio_validate_settings (as))) {
audio_print_settings (as);
goto fail;