]> www.infradead.org Git - users/jedix/linux-maple.git/commit
vmxnet3: avoid assumption about invalid dma_pa in vmxnet3_set_mc()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Fri, 14 Oct 2016 21:01:20 +0000 (00:01 +0300)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 6 Mar 2017 21:30:11 +0000 (13:30 -0800)
commit0bbc9668a9f3155e1754b23436261556f18d6b53
treefe5ebc51de8caadbd17f02cf4319e2d2a333ef5c
parentfd3bf6182c4772f43dab811197d6e0b4fcf55287
vmxnet3: avoid assumption about invalid dma_pa in vmxnet3_set_mc()

Orabug: 25639933

vmxnet3_set_mc() checks new_table_pa returned by dma_map_single()
with dma_mapping_error(), but even there it assumes zero is invalid pa
(it assumes dma_mapping_error(...,0) returns true if new_table is NULL).

The patch adds an explicit variable to track status of new_table_pa.

Found by Linux Driver Verification project (linuxtesting.org).

v2: use "bool" and "true"/"false" for boolean variables.
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit fb5c6cfaec126d9a96b9dd471d4711bf4c737a6f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/vmxnet3/vmxnet3_drv.c