diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2011-03-28 13:12:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-30 03:12:33 -0400 |
commit | fd1d9188f2cb81fe63c789d9f5463dca402ade12 (patch) | |
tree | 9f09b2f889c91b448ae9cfe9622450930f7b1edd /drivers/net/irda/via-ircc.c | |
parent | abc45592bce8267a8e651c12ce94a1f83eaac7a6 (diff) |
via-ircc: Pass PCI device pointer to dma_{alloc, free}_coherent()
via-ircc has been passing a NULL pointer to DMA allocation functions,
which is completely invalid and results in a BUG on PowerPC. Now
that we always have the device pointer available, pass it in.
Reference: http://bugs.debian.org/619450
Reported-by: Andrew Buckeridge <andrewb@bgc.com.au>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Tested-by: Andrew Buckeridge <andrewb@bgc.com.au> [against 2.6.32]
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/irda/via-ircc.c')
-rw-r--r-- | drivers/net/irda/via-ircc.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c index cc6faca35160..186cd28a61cc 100644 --- a/drivers/net/irda/via-ircc.c +++ b/drivers/net/irda/via-ircc.c | |||
@@ -363,7 +363,7 @@ static __devinit int via_ircc_open(struct pci_dev *pdev, chipio_t * info, | |||
363 | 363 | ||
364 | /* Allocate memory if needed */ | 364 | /* Allocate memory if needed */ |
365 | self->rx_buff.head = | 365 | self->rx_buff.head = |
366 | dma_alloc_coherent(NULL, self->rx_buff.truesize, | 366 | dma_alloc_coherent(&pdev->dev, self->rx_buff.truesize, |
367 | &self->rx_buff_dma, GFP_KERNEL); | 367 | &self->rx_buff_dma, GFP_KERNEL); |
368 | if (self->rx_buff.head == NULL) { | 368 | if (self->rx_buff.head == NULL) { |
369 | err = -ENOMEM; | 369 | err = -ENOMEM; |
@@ -372,7 +372,7 @@ static __devinit int via_ircc_open(struct pci_dev *pdev, chipio_t * info, | |||
372 | memset(self->rx_buff.head, 0, self->rx_buff.truesize); | 372 | memset(self->rx_buff.head, 0, self->rx_buff.truesize); |
373 | 373 | ||
374 | self->tx_buff.head = | 374 | self->tx_buff.head = |
375 | dma_alloc_coherent(NULL, self->tx_buff.truesize, | 375 | dma_alloc_coherent(&pdev->dev, self->tx_buff.truesize, |
376 | &self->tx_buff_dma, GFP_KERNEL); | 376 | &self->tx_buff_dma, GFP_KERNEL); |
377 | if (self->tx_buff.head == NULL) { | 377 | if (self->tx_buff.head == NULL) { |
378 | err = -ENOMEM; | 378 | err = -ENOMEM; |
@@ -404,10 +404,10 @@ static __devinit int via_ircc_open(struct pci_dev *pdev, chipio_t * info, | |||
404 | via_hw_init(self); | 404 | via_hw_init(self); |
405 | return 0; | 405 | return 0; |
406 | err_out4: | 406 | err_out4: |
407 | dma_free_coherent(NULL, self->tx_buff.truesize, | 407 | dma_free_coherent(&pdev->dev, self->tx_buff.truesize, |
408 | self->tx_buff.head, self->tx_buff_dma); | 408 | self->tx_buff.head, self->tx_buff_dma); |
409 | err_out3: | 409 | err_out3: |
410 | dma_free_coherent(NULL, self->rx_buff.truesize, | 410 | dma_free_coherent(&pdev->dev, self->rx_buff.truesize, |
411 | self->rx_buff.head, self->rx_buff_dma); | 411 | self->rx_buff.head, self->rx_buff_dma); |
412 | err_out2: | 412 | err_out2: |
413 | release_region(self->io.fir_base, self->io.fir_ext); | 413 | release_region(self->io.fir_base, self->io.fir_ext); |
@@ -441,10 +441,10 @@ static void __devexit via_remove_one(struct pci_dev *pdev) | |||
441 | __func__, self->io.fir_base); | 441 | __func__, self->io.fir_base); |
442 | release_region(self->io.fir_base, self->io.fir_ext); | 442 | release_region(self->io.fir_base, self->io.fir_ext); |
443 | if (self->tx_buff.head) | 443 | if (self->tx_buff.head) |
444 | dma_free_coherent(NULL, self->tx_buff.truesize, | 444 | dma_free_coherent(&pdev->dev, self->tx_buff.truesize, |
445 | self->tx_buff.head, self->tx_buff_dma); | 445 | self->tx_buff.head, self->tx_buff_dma); |
446 | if (self->rx_buff.head) | 446 | if (self->rx_buff.head) |
447 | dma_free_coherent(NULL, self->rx_buff.truesize, | 447 | dma_free_coherent(&pdev->dev, self->rx_buff.truesize, |
448 | self->rx_buff.head, self->rx_buff_dma); | 448 | self->rx_buff.head, self->rx_buff_dma); |
449 | pci_set_drvdata(pdev, NULL); | 449 | pci_set_drvdata(pdev, NULL); |
450 | 450 | ||