aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
authorMartin Mathieson <martin.mathieson@keysight.com>2020-05-16 12:14:05 +0100
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2020-05-16 11:37:06 +0000
commitcf340fa0ec458e9a0fd97f4e6a6bd427217fd441 (patch)
tree3d9344091d6149f2b1aea70b22612c3c91874c6f /epan/dissectors
parent7794527604e27e6da88d4871ba27aa48ec89abd1 (diff)
USB: fix redundant assignments or tests flagged by PVS-Studio
Bug: 16335 Change-Id: I19ea32fb607bf4132c1690f46dca5ed055009b84 Reviewed-on: https://code.wireshark.org/review/37211 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-usb-com.c1
-rw-r--r--epan/dissectors/packet-usb-dfu.c10
2 files changed, 4 insertions, 7 deletions
diff --git a/epan/dissectors/packet-usb-com.c b/epan/dissectors/packet-usb-com.c
index 8fc7805d75..2785469e29 100644
--- a/epan/dissectors/packet-usb-com.c
+++ b/epan/dissectors/packet-usb-com.c
@@ -479,7 +479,6 @@ dissect_usb_com_descriptor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
k_device_address = usb_conv_info->device_address;
k_frame_number = pinfo->num;
- offset = 3;
control_item = proto_tree_add_item_ret_uint(subtree, hf_usb_com_descriptor_control_interface, tvb, offset, 1, ENC_LITTLE_ENDIAN, &master);
if (master != usb_conv_info->interfaceNum) {
diff --git a/epan/dissectors/packet-usb-dfu.c b/epan/dissectors/packet-usb-dfu.c
index fb1b18b6d8..9497ae3900 100644
--- a/epan/dissectors/packet-usb-dfu.c
+++ b/epan/dissectors/packet-usb-dfu.c
@@ -338,13 +338,11 @@ dissect_usb_dfu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
command_tree = proto_item_add_subtree(command_item, ett_command);
proto_item_set_generated(command_item);
- if (command_data) {
- command_item = proto_tree_add_uint(main_tree, hf_setup_interface, tvb, offset, 0, command_data->interface);
- proto_item_set_generated(command_item);
+ command_item = proto_tree_add_uint(main_tree, hf_setup_interface, tvb, offset, 0, command_data->interface);
+ proto_item_set_generated(command_item);
- command_item = proto_tree_add_uint(main_tree, hf_command_in_frame, tvb, offset, 0, command_data->command_frame_number);
- proto_item_set_generated(command_item);
- }
+ command_item = proto_tree_add_uint(main_tree, hf_command_in_frame, tvb, offset, 0, command_data->command_frame_number);
+ proto_item_set_generated(command_item);
switch (command_response) {
case 0x02: /* Upload */