Skip to content

Commit 1c55bc8

Browse files
committed
Merge tag 'firewire-fixes-6.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394
Pull firewire fix from Takashi Sakamoto: "A fix for PCI driver for Texas Instruments PCILyx series. The driver had a bug where it allocated a DMA-coherent buffer of 16 KB but released it using PAGE_SIZE. This disproportion was reported in 2020, but the fix was never merged. It is finally resolved" * tag 'firewire-fixes-6.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394: firewire: nosy: Fix dma_free_coherent() size
2 parents 03de3e4 + c48c0fd commit 1c55bc8

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/firewire/nosy.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636

3737
static char driver_name[] = KBUILD_MODNAME;
3838

39+
#define RCV_BUFFER_SIZE (16 * 1024)
40+
3941
/* this is the physical layout of a PCL, its size is 128 bytes */
4042
struct pcl {
4143
__le32 next;
@@ -517,16 +519,14 @@ remove_card(struct pci_dev *dev)
517519
lynx->rcv_start_pcl, lynx->rcv_start_pcl_bus);
518520
dma_free_coherent(&lynx->pci_device->dev, sizeof(struct pcl),
519521
lynx->rcv_pcl, lynx->rcv_pcl_bus);
520-
dma_free_coherent(&lynx->pci_device->dev, PAGE_SIZE, lynx->rcv_buffer,
521-
lynx->rcv_buffer_bus);
522+
dma_free_coherent(&lynx->pci_device->dev, RCV_BUFFER_SIZE,
523+
lynx->rcv_buffer, lynx->rcv_buffer_bus);
522524

523525
iounmap(lynx->registers);
524526
pci_disable_device(dev);
525527
lynx_put(lynx);
526528
}
527529

528-
#define RCV_BUFFER_SIZE (16 * 1024)
529-
530530
static int
531531
add_card(struct pci_dev *dev, const struct pci_device_id *unused)
532532
{
@@ -680,7 +680,7 @@ add_card(struct pci_dev *dev, const struct pci_device_id *unused)
680680
dma_free_coherent(&lynx->pci_device->dev, sizeof(struct pcl),
681681
lynx->rcv_pcl, lynx->rcv_pcl_bus);
682682
if (lynx->rcv_buffer)
683-
dma_free_coherent(&lynx->pci_device->dev, PAGE_SIZE,
683+
dma_free_coherent(&lynx->pci_device->dev, RCV_BUFFER_SIZE,
684684
lynx->rcv_buffer, lynx->rcv_buffer_bus);
685685
iounmap(lynx->registers);
686686

0 commit comments

Comments
 (0)