android_kernel_oneplus_msm8998/drivers/net/ethernet/cavium
Florian Fainelli 1d1cb76252 net: cavium: liquidio: Avoid dma_unmap_single on uninitialized ndata
commit 8e6ce7ebeb34f0992f56de078c3744fb383657fa upstream.

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: f21fb3ed36 ("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>
Cc: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-02 21:19:49 -07:00
..
liquidio net: cavium: liquidio: Avoid dma_unmap_single on uninitialized ndata 2017-05-02 21:19:49 -07:00
thunder net: thunderx: Fix OOPs with ethtool --register-dump 2016-09-24 10:07:39 +02:00
Kconfig net: cavium: change NET_VENDOR_CAVIUM to bool 2015-10-21 19:12:16 -07:00
Makefile Add support of Cavium Liquidio ethernet adapters 2015-06-10 22:44:08 -07:00