summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/cavium
diff options
context:
space:
mode:
authorFelix Manlunas <felix.manlunas@cavium.com>2017-03-20 19:04:48 -0700
committerDavid S. Miller <davem@davemloft.net>2017-03-22 11:48:34 -0700
commit58ad3198342bda5eeb97c070dde76335bf0b7203 (patch)
tree39c55656ce03ca1ae90f4a86c26e9677d84b5cf7 /drivers/net/ethernet/cavium
parentcfc62d878f8d436e6a2a99cef5559a7a98c43b3c (diff)
downloadtalos-op-linux-58ad3198342bda5eeb97c070dde76335bf0b7203.tar.gz
talos-op-linux-58ad3198342bda5eeb97c070dde76335bf0b7203.zip
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')
-rw-r--r--drivers/net/ethernet/cavium/liquidio/lio_main.c3
-rw-r--r--drivers/net/ethernet/cavium/liquidio/lio_vf_main.c3
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],
OpenPOWER on IntegriCloud