From e05c12f28b4bc8e4d7c5ba47f4bdb51243f9f252 Mon Sep 17 00:00:00 2001 From: Tanu Kaskinen Date: Wed, 5 Jun 2013 17:45:06 +0300 Subject: [PATCH] bluetooth: Fix too late assertion u was dereferenced before the assertion that checks that u isn't NULL. --- src/modules/bluetooth/module-bluetooth-device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c index f82033aa2..a517e59d7 100644 --- a/src/modules/bluetooth/module-bluetooth-device.c +++ b/src/modules/bluetooth/module-bluetooth-device.c @@ -2233,11 +2233,13 @@ static int add_card(struct userdata *u) { pa_bt_form_factor_t ff; char *n; const char *default_profile; - const pa_bluetooth_device *device = u->device; + const pa_bluetooth_device *device; const pa_bluetooth_uuid *uuid; pa_assert(u); - pa_assert(device); + pa_assert(u->device); + + device = u->device; pa_card_new_data_init(&data); data.driver = __FILE__;