mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-11 17:10:13 +00:00
firewire fixes for 6.19-rc3
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. -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQQE66IEYNDXNBPeGKSsLtaWM8LwEwUCaVEkHAAKCRCsLtaWM8Lw E47xAQCakWPjeQ1S64vK9lmNAcUjWRw/YhacDLVv3euEBjSzuwEAwvK3pPv95IlA fO6V8UVJN+Lg5dwusM+fdleZqvR4mQ4= =UZIn -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
1c55bc8710
@ -36,6 +36,8 @@
|
|||||||
|
|
||||||
static char driver_name[] = KBUILD_MODNAME;
|
static char driver_name[] = KBUILD_MODNAME;
|
||||||
|
|
||||||
|
#define RCV_BUFFER_SIZE (16 * 1024)
|
||||||
|
|
||||||
/* this is the physical layout of a PCL, its size is 128 bytes */
|
/* this is the physical layout of a PCL, its size is 128 bytes */
|
||||||
struct pcl {
|
struct pcl {
|
||||||
__le32 next;
|
__le32 next;
|
||||||
@ -517,16 +519,14 @@ remove_card(struct pci_dev *dev)
|
|||||||
lynx->rcv_start_pcl, lynx->rcv_start_pcl_bus);
|
lynx->rcv_start_pcl, lynx->rcv_start_pcl_bus);
|
||||||
dma_free_coherent(&lynx->pci_device->dev, sizeof(struct pcl),
|
dma_free_coherent(&lynx->pci_device->dev, sizeof(struct pcl),
|
||||||
lynx->rcv_pcl, lynx->rcv_pcl_bus);
|
lynx->rcv_pcl, lynx->rcv_pcl_bus);
|
||||||
dma_free_coherent(&lynx->pci_device->dev, PAGE_SIZE, lynx->rcv_buffer,
|
dma_free_coherent(&lynx->pci_device->dev, RCV_BUFFER_SIZE,
|
||||||
lynx->rcv_buffer_bus);
|
lynx->rcv_buffer, lynx->rcv_buffer_bus);
|
||||||
|
|
||||||
iounmap(lynx->registers);
|
iounmap(lynx->registers);
|
||||||
pci_disable_device(dev);
|
pci_disable_device(dev);
|
||||||
lynx_put(lynx);
|
lynx_put(lynx);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define RCV_BUFFER_SIZE (16 * 1024)
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
add_card(struct pci_dev *dev, const struct pci_device_id *unused)
|
add_card(struct pci_dev *dev, const struct pci_device_id *unused)
|
||||||
{
|
{
|
||||||
@ -680,7 +680,7 @@ fail_deallocate_buffers:
|
|||||||
dma_free_coherent(&lynx->pci_device->dev, sizeof(struct pcl),
|
dma_free_coherent(&lynx->pci_device->dev, sizeof(struct pcl),
|
||||||
lynx->rcv_pcl, lynx->rcv_pcl_bus);
|
lynx->rcv_pcl, lynx->rcv_pcl_bus);
|
||||||
if (lynx->rcv_buffer)
|
if (lynx->rcv_buffer)
|
||||||
dma_free_coherent(&lynx->pci_device->dev, PAGE_SIZE,
|
dma_free_coherent(&lynx->pci_device->dev, RCV_BUFFER_SIZE,
|
||||||
lynx->rcv_buffer, lynx->rcv_buffer_bus);
|
lynx->rcv_buffer, lynx->rcv_buffer_bus);
|
||||||
iounmap(lynx->registers);
|
iounmap(lynx->registers);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user