summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2008-10-12 00:01:43 +0100
committerJohan Hedberg <johan.hedberg@nokia.com>2008-10-12 20:06:41 +0200
commitecfcd2f2992c946ff3ce7dd2db0a343d704e853f (patch)
treea8bbf57cb6be4395dbb88dbe6e024c76de0d488f /input
parent6117466648d00be7900243e88aebde8e6aece40b (diff)
Fix possible crash on startup
0 0x0000000000a5cf71 in sdp_data_get (rec=0x0, attrId=0) at sdp.c:1444 1 0x000000008c704721 in hid_device_probe (device=0x7f1bed2a80b0, uuids=0x7f1bed29fa90) at manager.c:70 2 0x00007f1becb5bc33 in device_probe_drivers (device=0x7f1bed2a80b0, uuids=0x7f1bed2a2980) at device.c:647 3 0x00007f1becb58a23 in create_stored_device_from_profiles (key=0x7f1bed2a7360 "00:1E:45:AD:F1:96", value=0x7f1bed2a7aa0 "00000002-0000-1000-8000-0002ee000002 00001101-0000-1000-8000-00805f9b34fb 00001103-0000-1000-8000-00805f9b34fb 00001104-0000-1000-8000-00805f9b34fb 00001105-0000-1000-8000-00805f9b34fb 00001106-0000-1"..., user_data=0x7f1bed29edd0) at adapter.c:2296 4 0x00007f1becb61d12 in textfile_foreach (pathname=0x7ffff4b6f2a0 "/var/lib/bluetooth/00:13:EF:F1:42:B7/profiles", func=0x7f1becb58955 <create_stored_device_from_profiles>, data=0x7f1bed29edd0) at textfile.c:447 5 0x00007f1becb58b36 in load_devices (adapter=0x7f1bed29edd0) at adapter.c:2327 6 0x00007f1becb58fa0 in adapter_up (adapter=0x7f1bed29edd0, dd=18) at adapter.c:2462 7 0x00007f1becb59479 in adapter_start (adapter=0x7f1bed29edd0) at adapter.c:2569 8 0x00007f1becb5427f in manager_start_adapter (id=0) at manager.c:424 9 0x00007f1becb48e02 in device_devup_setup (dev_id=0) at main.c:481 10 0x00007f1becb48f35 in init_all_devices (ctl=7) at main.c:512 11 0x00007f1becb496d0 in main (argc=1, argv=0x7ffff4b70788) at main.c:748 The HID device's SDP record can be NULL, so don't crash when that happens
Diffstat (limited to 'input')
-rw-r--r--input/manager.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/input/manager.c b/input/manager.c
index 51634e3d..25b64e4a 100644
--- a/input/manager.c
+++ b/input/manager.c
@@ -65,6 +65,9 @@ static int hid_device_probe(struct btd_device *device, GSList *uuids)
DBG("path %s", path);
+ if (!rec)
+ return -1;
+
adapter_get_address(adapter, &src);
device_get_address(device, &dst);
pdlist = sdp_data_get(rec, SDP_SERVER_RECORD_HANDLE);