Commit d0aeb0d4 authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by David S. Miller

isdn: hfcpci: check the return value of dma_set_mask() in setup_hw()

The function dma_set_mask() in setup_hw() can fail, so its return value
should be checked.

Fixes: 1700fe1a ("Add mISDN HFC PCI driver")
Reported-by: default avatarTOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent afb3cc1a
...@@ -2005,7 +2005,11 @@ setup_hw(struct hfc_pci *hc) ...@@ -2005,7 +2005,11 @@ setup_hw(struct hfc_pci *hc)
} }
/* Allocate memory for FIFOS */ /* Allocate memory for FIFOS */
/* the memory needs to be on a 32k boundary within the first 4G */ /* the memory needs to be on a 32k boundary within the first 4G */
dma_set_mask(&hc->pdev->dev, 0xFFFF8000); if (dma_set_mask(&hc->pdev->dev, 0xFFFF8000)) {
printk(KERN_WARNING
"HFC-PCI: No usable DMA configuration!\n");
return -EIO;
}
buffer = dma_alloc_coherent(&hc->pdev->dev, 0x8000, &hc->hw.dmahandle, buffer = dma_alloc_coherent(&hc->pdev->dev, 0x8000, &hc->hw.dmahandle,
GFP_KERNEL); GFP_KERNEL);
/* We silently assume the address is okay if nonzero */ /* We silently assume the address is okay if nonzero */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment