qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PULL 7/7] audio: add sanity check


From: Gerd Hoffmann
Subject: [PULL 7/7] audio: add sanity check
Date: Tue, 15 Dec 2020 14:48:26 +0100

Check whenever we actually found the spiceaudio driver
before flipping the can_be_default field.

Fixes: f0c4555edfdd ("audio: remove qemu_spice_audio_init()")
Buglink: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=977301
Reported-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-Id: <20201215081151.20095-1-kraxel@redhat.com>
---
 audio/audio.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/audio/audio.c b/audio/audio.c
index 0fdb808d6a57..b48471bb3f64 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1684,7 +1684,9 @@ static AudioState *audio_init(Audiodev *dev, const char 
*name)
          * backend and this can go away.
          */
         driver = audio_driver_lookup("spice");
-        driver->can_be_default = 1;
+        if (driver) {
+            driver->can_be_default = 1;
+        }
     }
 
     if (dev) {
-- 
2.27.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]