aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bthci_evt.c
diff options
context:
space:
mode:
authorMichal Labedzki <michal.labedzki@tieto.com>2016-01-21 09:23:42 +0100
committerMichael Mann <mmann78@netscape.net>2016-02-05 18:57:29 +0000
commitc09d894f7446aa394d04710876ed631af22b1497 (patch)
treedd17ff934afd6f386f8149d4869c6209bf60174b /epan/dissectors/packet-bthci_evt.c
parentfb033d0f39eda3f3937ae265c422ad907b179f42 (diff)
Fix some Coverity issue
>>> CID 1349726: Incorrect expression (COPY_PASTE_ERROR) >>> "tvb_reported_length_remaining" in "tvb_reported_length_remaining(tvb, offset)" looks like a copy-paste error. >>> CID 1349727: Incorrect expression (COPY_PASTE_ERROR) >>> "tree" in "dissector_try_uint_new(bluetooth_eir_ad_manufacturer_company_id, company_id, new_tvb, pinfo, >>> CID 1349728: (DEADCODE) >>> Execution cannot reach this expression "0" inside statement "(0 && ((__s1_len = __builti...". >>> CID 1306904: Logically dead code (DEADCODE) >>> Execution cannot reach this statement "tap_hci_summary->interface_...". Change-Id: I5f99e37e6d5fac39da7082649caa8373d06bb808 Reviewed-on: https://code.wireshark.org/review/13739 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-bthci_evt.c')
-rw-r--r--epan/dissectors/packet-bthci_evt.c60
1 files changed, 18 insertions, 42 deletions
diff --git a/epan/dissectors/packet-bthci_evt.c b/epan/dissectors/packet-bthci_evt.c
index b99ad06d99..8870b688fb 100644
--- a/epan/dissectors/packet-bthci_evt.c
+++ b/epan/dissectors/packet-bthci_evt.c
@@ -816,13 +816,9 @@ static void send_hci_summary_status_tap(guint8 status, packet_info *pinfo, bluet
bluetooth_hci_summary_tap_t *tap_hci_summary;
tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t);
- if (bluetooth_data) {
- tap_hci_summary->interface_id = bluetooth_data->interface_id;
- tap_hci_summary->adapter_id = bluetooth_data->adapter_id;
- } else {
- tap_hci_summary->interface_id = HCI_INTERFACE_DEFAULT;
- tap_hci_summary->adapter_id = HCI_ADAPTER_DEFAULT;
- }
+
+ tap_hci_summary->interface_id = bluetooth_data->interface_id;
+ tap_hci_summary->adapter_id = bluetooth_data->adapter_id;
tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_STATUS;
tap_hci_summary->status = status;
@@ -840,13 +836,9 @@ static void send_hci_summary_pending_tap(packet_info *pinfo, bluetooth_data_t *b
bluetooth_hci_summary_tap_t *tap_hci_summary;
tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t);
- if (bluetooth_data) {
- tap_hci_summary->interface_id = bluetooth_data->interface_id;
- tap_hci_summary->adapter_id = bluetooth_data->adapter_id;
- } else {
- tap_hci_summary->interface_id = HCI_INTERFACE_DEFAULT;
- tap_hci_summary->adapter_id = HCI_ADAPTER_DEFAULT;
- }
+
+ tap_hci_summary->interface_id = bluetooth_data->interface_id;
+ tap_hci_summary->adapter_id = bluetooth_data->adapter_id;
tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_STATUS_PENDING;
tap_hci_summary->status = 0;
@@ -861,13 +853,9 @@ static void send_hci_summary_reason_tap(guint8 reason, packet_info *pinfo, bluet
bluetooth_hci_summary_tap_t *tap_hci_summary;
tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t);
- if (bluetooth_data) {
- tap_hci_summary->interface_id = bluetooth_data->interface_id;
- tap_hci_summary->adapter_id = bluetooth_data->adapter_id;
- } else {
- tap_hci_summary->interface_id = HCI_INTERFACE_DEFAULT;
- tap_hci_summary->adapter_id = HCI_ADAPTER_DEFAULT;
- }
+
+ tap_hci_summary->interface_id = bluetooth_data->interface_id;
+ tap_hci_summary->adapter_id = bluetooth_data->adapter_id;
tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_REASON;
tap_hci_summary->reason = reason;
@@ -1522,13 +1510,9 @@ dissect_bthci_evt_hardware_error(tvbuff_t *tvb, int offset, packet_info *pinfo,
bluetooth_hci_summary_tap_t *tap_hci_summary;
tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t);
- if (bluetooth_data) {
- tap_hci_summary->interface_id = bluetooth_data->interface_id;
- tap_hci_summary->adapter_id = bluetooth_data->adapter_id;
- } else {
- tap_hci_summary->interface_id = HCI_INTERFACE_DEFAULT;
- tap_hci_summary->adapter_id = HCI_ADAPTER_DEFAULT;
- }
+
+ tap_hci_summary->interface_id = bluetooth_data->interface_id;
+ tap_hci_summary->adapter_id = bluetooth_data->adapter_id;
tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_HARDWARE_ERROR;
tap_hci_summary->hardware_error = tvb_get_guint8(tvb, offset - 1);
@@ -1712,13 +1696,9 @@ dissect_bthci_evt_command_status(tvbuff_t *tvb, int offset, packet_info *pinfo,
bluetooth_hci_summary_tap_t *tap_hci_summary;
tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t);
- if (bluetooth_data) {
- tap_hci_summary->interface_id = bluetooth_data->interface_id;
- tap_hci_summary->adapter_id = bluetooth_data->adapter_id;
- } else {
- tap_hci_summary->interface_id = HCI_INTERFACE_DEFAULT;
- tap_hci_summary->adapter_id = HCI_ADAPTER_DEFAULT;
- }
+
+ tap_hci_summary->interface_id = bluetooth_data->interface_id;
+ tap_hci_summary->adapter_id = bluetooth_data->adapter_id;
tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_EVENT_OPCODE;
tap_hci_summary->ogf = ogf;
@@ -4019,13 +3999,9 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
bluetooth_hci_summary_tap_t *tap_hci_summary;
tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t);
- if (bluetooth_data) {
- tap_hci_summary->interface_id = bluetooth_data->interface_id;
- tap_hci_summary->adapter_id = bluetooth_data->adapter_id;
- } else {
- tap_hci_summary->interface_id = HCI_INTERFACE_DEFAULT;
- tap_hci_summary->adapter_id = HCI_ADAPTER_DEFAULT;
- }
+
+ tap_hci_summary->interface_id = bluetooth_data->interface_id;
+ tap_hci_summary->adapter_id = bluetooth_data->adapter_id;
tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_EVENT;
tap_hci_summary->event = evt_code;