From ccd552a838a2503c558c29369747ffe85e144ab5 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 2 Jul 2015 12:03:42 -0700 Subject: Remove more unnecessary null checks. These routines are called from dissect_bthci_evt(), which ensures that bluetooth_data is non-null, and passes that non-null value to the routines. Should fix CIDs 1306908 and 1306911. Change-Id: Ie25de02f36bda9a9ae25ced034e758fc7f745681 Reviewed-on: https://code.wireshark.org/review/9472 Reviewed-by: Guy Harris --- epan/dissectors/packet-bthci_evt.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/epan/dissectors/packet-bthci_evt.c b/epan/dissectors/packet-bthci_evt.c index 02b15c4b0f..ee41d4293d 100644 --- a/epan/dissectors/packet-bthci_evt.c +++ b/epan/dissectors/packet-bthci_evt.c @@ -1195,13 +1195,8 @@ dissect_bthci_evt_remote_name_req_complete(tvbuff_t *tvb, int offset, bluetooth_device_tap_t *tap_device; tap_device = wmem_new(wmem_packet_scope(), bluetooth_device_tap_t); - if (bluetooth_data) { - tap_device->interface_id = bluetooth_data->interface_id; - tap_device->adapter_id = bluetooth_data->adapter_id; - } else { - tap_device->interface_id = HCI_INTERFACE_DEFAULT; - tap_device->adapter_id = HCI_ADAPTER_DEFAULT; - } + tap_device->interface_id = bluetooth_data->interface_id; + tap_device->adapter_id = bluetooth_data->adapter_id; memcpy(tap_device->bd_addr, bd_addr, 6); tap_device->has_bd_addr = TRUE; tap_device->is_local = FALSE; @@ -1267,13 +1262,8 @@ dissect_bthci_evt_read_remote_version_information_complete(tvbuff_t *tvb, int of tap_device = wmem_new(wmem_packet_scope(), bluetooth_device_tap_t); tap_device->type = BLUETOOTH_DEVICE_REMOTE_VERSION; - if (bluetooth_data) { - tap_device->interface_id = bluetooth_data->interface_id; - tap_device->adapter_id = bluetooth_data->adapter_id; - } else { - tap_device->interface_id = HCI_INTERFACE_DEFAULT; - tap_device->adapter_id = HCI_ADAPTER_DEFAULT; - } + tap_device->interface_id = bluetooth_data->interface_id; + tap_device->adapter_id = bluetooth_data->adapter_id; if (remote_bdaddr) { tap_device->has_bd_addr = TRUE; -- cgit v1.2.1