#ifndef IPV6_H #define IPV6_H #include #include "built_in.h" /* * IPv6 fixed header * * BEWARE, it is incorrect. The first 4 bits of flow_lbl * are glued to priority now, forming "class". */ struct ipv6hdr { #if defined(__LITTLE_ENDIAN_BITFIELD) __extension__ uint8_t priority:4, version:4; #elif defined(__BIG_ENDIAN_BITFIELD) __extension__ uint8_t version:4, priority:4; #else # error "Please fix " #endif uint8_t flow_lbl[3]; uint16_t payload_len; uint8_t nexthdr; uint8_t hop_limit; struct in6_addr saddr; struct in6_addr daddr; } __packed; #endif /* IPV6_H */
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2016-07-15 16:42:16 -0700
committerDavid S. Miller <davem@davemloft.net>2016-07-16 22:06:00 -0700
commit8e6ce7ebeb34f0992f56de078c3744fb383657fa (patch)
tree45e45ffd2d44c992615d3f3495df7e271858e75a
parentea6ff112b095dce2060c304195904d859c3e2625 (diff)
net: cavium: liquidio: Avoid dma_unmap_single on uninitialized ndata
The label lio_xmit_failed is used 3 times through liquidio_xmit() but it always makes a call to dma_unmap_single() using potentially uninitialized variables from "ndata" variable. Out of the 3 gotos, 2 run after ndata has been initialized, and had a prior dma_map_single() call. Fix this by adding a new error label: lio_xmit_dma_failed which does this dma_unmap_single() and then processed with the lio_xmit_failed fallthrough. Fixes: f21fb3ed364bb ("Add support of Cavium Liquidio ethernet adapters") Reported-by: coverity (CID 1309740) Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>