From: Dean Nelson Date: Thu, 11 Nov 2010 05:50:25 +0000 (+0000) Subject: e1000: fix return value not set on error X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=19a0b67afd174c4db261d587b5c67704dcd53c17;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git e1000: fix return value not set on error Dean noticed that 'err' wasn't being set when the "goto err_dma" statement is executed in the following hunk from the commit. It's value will be zero as a result of a successful call to e1000_init_hw_struct(). This patch changes the error condition to be correctly propagated. CC: stable@kernel.org Signed-off-by: Dean Nelson Signed-off-by: Jesse Brandeburg Tested-by: Emil Tantilov Signed-off-by: Jeff Kirsher --- diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 06c7d1c67517..491bf2a1babd 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c @@ -971,11 +971,13 @@ static int __devinit e1000_probe(struct pci_dev *pdev, */ dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64)); pci_using_dac = 1; - } else if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) { - dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); } else { - pr_err("No usable DMA config, aborting\n"); - goto err_dma; + err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); + if (err) { + pr_err("No usable DMA config, aborting\n"); + goto err_dma; + } + dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); } netdev->netdev_ops = &e1000_netdev_ops;