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>
This commit is contained in:
Martin Mathieson 2020-05-16 12:14:05 +01:00 committed by Martin Mathieson
parent 7794527604
commit cf340fa0ec
2 changed files with 4 additions and 7 deletions

View File

@ -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) {

View File

@ -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 */