diff options
author | Felix Manlunas <felix.manlunas@cavium.com> | 2017-03-21 05:04:48 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-03-22 21:48:34 +0300 |
commit | 58ad3198342bda5eeb97c070dde76335bf0b7203 (patch) | |
tree | 39c55656ce03ca1ae90f4a86c26e9677d84b5cf7 /drivers/net/ethernet/cavium/liquidio | |
parent | cfc62d878f8d436e6a2a99cef5559a7a98c43b3c (diff) | |
download | linux-58ad3198342bda5eeb97c070dde76335bf0b7203.tar.xz |
liquidio: fix Coverity scan errors
Fix Coverity scan errors by not dereferencing lio->glists_dma_base pointer
if it's NULL.
See http://marc.info/?l=linux-netdev&m=149002294305614&w=2
Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: VSR Burru <veerasenareddy.burru@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cavium/liquidio')
-rw-r--r-- | drivers/net/ethernet/cavium/liquidio/lio_main.c | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c index b23485c3af13..0bc76ad96a17 100644 --- a/drivers/net/ethernet/cavium/liquidio/lio_main.c +++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c @@ -712,7 +712,8 @@ static void delete_glists(struct lio *lio) kfree(g); } while (g); - if (lio->glists_virt_base && lio->glists_virt_base[i]) { + if (lio->glists_virt_base && lio->glists_virt_base[i] && + lio->glists_dma_base && lio->glists_dma_base[i]) { lio_dma_free(lio->oct_dev, lio->glist_entry_size * lio->tx_qsize, lio->glists_virt_base[i], diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c index f72db33fcd3a..e03855b8d1f5 100644 --- a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c +++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c @@ -470,7 +470,8 @@ static void delete_glists(struct lio *lio) kfree(g); } while (g); - if (lio->glists_virt_base && lio->glists_virt_base[i]) { + if (lio->glists_virt_base && lio->glists_virt_base[i] && + lio->glists_dma_base && lio->glists_dma_base[i]) { lio_dma_free(lio->oct_dev, lio->glist_entry_size * lio->tx_qsize, lio->glists_virt_base[i], |