Skip to content

Commit

Permalink
net: e1000e: fix dead code in e1000e_write_packet_to_guest
Browse files Browse the repository at this point in the history
Because is_first is declared inside a loop, it is always true.  The store
is dead, and so is the "else" branch of "if (is_first)".  is_last is
okay though.

Reported by Coverity.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
  • Loading branch information
bonzini authored and jasowang committed Feb 15, 2017
1 parent a2dbe13 commit e514fc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/net/e1000e_core.c
Expand Up @@ -1507,14 +1507,14 @@ e1000e_write_packet_to_guest(E1000ECore *core, struct NetRxPkt *pkt,
const E1000E_RingInfo *rxi;
size_t ps_hdr_len = 0;
bool do_ps = e1000e_do_ps(core, pkt, &ps_hdr_len);
bool is_first = true;

rxi = rxr->i;

do {
hwaddr ba[MAX_PS_BUFFERS];
e1000e_ba_state bastate = { { 0 } };
bool is_last = false;
bool is_first = true;

desc_size = total_size - desc_offset;

Expand Down

0 comments on commit e514fc7

Please sign in to comment.