]> git.proxmox.com Git - qemu.git/commitdiff
audio: Fix warning from static code analysis
authorStefan Weil <sw@weilnetz.de>
Mon, 3 Sep 2012 09:25:16 +0000 (09:25 +0000)
committermalc <av1474@comtv.ru>
Sat, 22 Sep 2012 21:34:16 +0000 (01:34 +0400)
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>
audio/audio_template.h

index 519432a7c560961181a2d7f66b49e87026956940..16f788077000229d40594b593992783fab1c16da 100644 (file)
@@ -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;