diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2017-01-26 11:10:10 +0100 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2017-02-15 11:18:57 +0800 |
commit | e514fc7e1231c6d95011e448e6c626f2bb6f3cd8 (patch) | |
tree | 3b76f8f974e80084a2f9eb6fc22868b761c0c040 /hw/net/e1000e_core.c | |
parent | a2dbe1356faff3cb613ae83b77c484a203be5f15 (diff) |
net: e1000e: fix dead code in e1000e_write_packet_to_guest
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>
Diffstat (limited to 'hw/net/e1000e_core.c')
-rw-r--r-- | hw/net/e1000e_core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index 2b11499829..c99e2fbd62 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -1507,6 +1507,7 @@ 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; @@ -1514,7 +1515,6 @@ e1000e_write_packet_to_guest(E1000ECore *core, struct NetRxPkt *pkt, hwaddr ba[MAX_PS_BUFFERS]; e1000e_ba_state bastate = { { 0 } }; bool is_last = false; - bool is_first = true; desc_size = total_size - desc_offset; |