The dereference to 'zdev' should be moved below the NULL test.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
static void dma_cleanup_tables(struct zpci_dev *zdev)
{
- unsigned long *table = zdev->dma_table;
+ unsigned long *table;
int rtx;
if (!zdev || !zdev->dma_table)
return;
+ table = zdev->dma_table;
for (rtx = 0; rtx < ZPCI_TABLE_ENTRIES; rtx++)
if (reg_entry_isvalid(table[rtx]))
dma_free_seg_table(table[rtx]);