[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200624192325.940280-1-christophe.jaillet@wanadoo.fr>
Date: Wed, 24 Jun 2020 21:23:25 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: stefanr@...6.in-berlin.de, krh@...planet.net, hch@...radead.org
Cc: linux1394-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: [PATCH] firewire: nosy: Fix the amount of memory deallocated by some 'pci_free_consistent' calls
'lynx->pci_device' is allocated with a size of RCV_BUFFER_SIZE. This is to
say (16 * 1024).
Pass the same size when it is freed.
Fixes: 286468210d83 ("firewire: new driver: nosy - IEEE 1394 traffic sniffer")
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
drivers/firewire/nosy.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c
index 5fd6a60b6741..445c37f5251d 100644
--- a/drivers/firewire/nosy.c
+++ b/drivers/firewire/nosy.c
@@ -510,7 +510,7 @@ remove_card(struct pci_dev *dev)
lynx->rcv_start_pcl, lynx->rcv_start_pcl_bus);
pci_free_consistent(lynx->pci_device, sizeof(struct pcl),
lynx->rcv_pcl, lynx->rcv_pcl_bus);
- pci_free_consistent(lynx->pci_device, PAGE_SIZE,
+ pci_free_consistent(lynx->pci_device, RCV_BUFFER_SIZE,
lynx->rcv_buffer, lynx->rcv_buffer_bus);
iounmap(lynx->registers);
@@ -668,7 +668,7 @@ add_card(struct pci_dev *dev, const struct pci_device_id *unused)
pci_free_consistent(lynx->pci_device, sizeof(struct pcl),
lynx->rcv_pcl, lynx->rcv_pcl_bus);
if (lynx->rcv_buffer)
- pci_free_consistent(lynx->pci_device, PAGE_SIZE,
+ pci_free_consistent(lynx->pci_device, RCV_BUFFER_SIZE,
lynx->rcv_buffer, lynx->rcv_buffer_bus);
iounmap(lynx->registers);
--
2.25.1
Powered by blists - more mailing lists