diff --git a/profiles/input/device.c b/profiles/input/device.c
index 759603a..9e485cf 100644
--- a/profiles/input/device.c
+++ b/profiles/input/device.c
}
}
-static void extract_hid_record(sdp_record_t *rec, struct hidp_connadd_req *req)
+static int extract_hid_record(sdp_record_t *rec, struct hidp_connadd_req *req)
{
sdp_data_t *pdlist, *pdlist2;
uint8_t attr_val;
epox_endian_quirk(req->rd_data, req->rd_size);
}
}
+
+ return 0;
}
static int ioctl_connadd(struct hidp_connadd_req *req)
rec = record_from_string(str);
g_free(str);
- extract_hid_record(rec, req);
+ err = extract_hid_record(rec, req);
sdp_record_free(rec);
+ if (err < 0) {
+ error("Could not parse HID SDP record: %s (%d)", strerror(-err),
+ -err);
+ goto cleanup;
+ }
req->vendor = btd_device_get_vendor(idev->device);
req->product = btd_device_get_product(idev->device);