[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[tyndur-devel] [PATCH] cdi/audio: RPC-Daten prüefen
! cdi/audio: RPC(is_playback_device) sollte prüfen, ob auch wirklich ein
gültiges Gerät angefordert worden ist, sonst könnte es rot geben.
Signed-off-by: Kevin Wolf <kevin@xxxxxxxxxx>
---
src/modules/cdi/lib/audio.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/modules/cdi/lib/audio.c b/src/modules/cdi/lib/audio.c
index 7618c42..3ffb8f9 100644
--- a/src/modules/cdi/lib/audio.c
+++ b/src/modules/cdi/lib/audio.c
@@ -124,6 +124,11 @@ RPC(is_playback_device)
struct cdi_audio_device* dev =
cdi_list_get(adriver->drv.devices, ((int*) data)[0]);
+ if (dev == NULL) {
+ rpc_int_resp(-1);
+ return;
+ }
+
rpc_int_resp(!dev->record);
}
--
1.6.0.2