e1000: cleanup process_tx_desc
commita0ae17a63e08a57a644eacc1f0fd89d535ed36bf
authorAndrew Jones <drjones@redhat.com>
Tue, 4 Jun 2013 08:49:48 +0000 (4 10:49 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 4 Jul 2013 07:40:56 +0000 (4 10:40 +0300)
tree9778a305f2cc69b8fcd0c2cd68e08eb5360b282d
parentfcbe0a707a227ea25f06382e61ff9b2761c77661
e1000: cleanup process_tx_desc

Coverity complains about two overruns in process_tx_desc(). The
complaints are false positives, but we might as well eliminate
them. The problem is that "hdr" is defined as an unsigned int,
but then used to offset an array of size 65536, and another of
size 256 bytes. hdr will actually never be greater than 255
though, as it's assigned only once and to the value of
tp->hdr_len, which is an uint8_t. This patch simply gets rid of
hdr, replacing it with tp->hdr_len, which makes it consistent
with all other tp member use in the function.

v2:
 - also cleanup coding style issues in the touched lines

Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/net/e1000.c