提交 bafff174 编写于 作者: W Wei Yongjun 提交者: Martin Schwidefsky

s390/pci: fix potential NULL pointer dereference in dma_free_seg_table()

The dereference to 'zdev' should be moved below the NULL test.
Signed-off-by: NWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 4118fee7
......@@ -193,12 +193,13 @@ static void dma_free_seg_table(unsigned long entry)
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]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册