diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-04-02 16:34:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-02 16:34:49 -0400 |
commit | 9092c658bab215b2752fa59d2a36c05b74d1e9e9 (patch) | |
tree | d8a1606d52ed328fce58ba94b420998998d9863f /net/core/dev.c | |
parent | ba343c7736b36d62d276e20383588bcf9403d6c6 (diff) |
net: illegal_highdma() fix
Followup to commit 5acbbd428db47b12f137a8a2aa96b3c0a96b744e
(net: change illegal_highdma to use dma_mask)
If dev->dev.parent is NULL, we should not try to dereference it.
Dont force inline illegal_highdma() as its pretty big now.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index e19cdae49fef..c6b52068d5ec 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1801,7 +1801,7 @@ EXPORT_SYMBOL(netdev_rx_csum_fault); | |||
1801 | * 2. No high memory really exists on this machine. | 1801 | * 2. No high memory really exists on this machine. |
1802 | */ | 1802 | */ |
1803 | 1803 | ||
1804 | static inline int illegal_highdma(struct net_device *dev, struct sk_buff *skb) | 1804 | static int illegal_highdma(struct net_device *dev, struct sk_buff *skb) |
1805 | { | 1805 | { |
1806 | #ifdef CONFIG_HIGHMEM | 1806 | #ifdef CONFIG_HIGHMEM |
1807 | int i; | 1807 | int i; |
@@ -1814,6 +1814,8 @@ static inline int illegal_highdma(struct net_device *dev, struct sk_buff *skb) | |||
1814 | if (PCI_DMA_BUS_IS_PHYS) { | 1814 | if (PCI_DMA_BUS_IS_PHYS) { |
1815 | struct device *pdev = dev->dev.parent; | 1815 | struct device *pdev = dev->dev.parent; |
1816 | 1816 | ||
1817 | if (!pdev) | ||
1818 | return 0; | ||
1817 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { | 1819 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { |
1818 | dma_addr_t addr = page_to_phys(skb_shinfo(skb)->frags[i].page); | 1820 | dma_addr_t addr = page_to_phys(skb_shinfo(skb)->frags[i].page); |
1819 | if (!pdev->dma_mask || addr + PAGE_SIZE - 1 > *pdev->dma_mask) | 1821 | if (!pdev->dma_mask || addr + PAGE_SIZE - 1 > *pdev->dma_mask) |