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>
This commit is contained in:
Felix Manlunas 2017-03-20 19:04:48 -07:00 committed by David S. Miller
parent cfc62d878f
commit 58ad319834
2 changed files with 4 additions and 2 deletions

View File

@ -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],

View File

@ -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],