* [PATCH] firewire: nosy: Fix dma_free_coherent() size
@ 2025-12-16 16:54 Thomas Fourier
2025-12-16 17:47 ` Christophe JAILLET
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Fourier @ 2025-12-16 16:54 UTC (permalink / raw)
Cc: Thomas Fourier, Takashi Sakamoto, Kristian Høgsberg,
Stefan Richter, linux1394-devel, linux-kernel
It looks like the buffer allocated and mapped in add_card() is done
with size RCV_BUFFER_SIZE which is 16 KB and 4KB.
Fixes: 286468210d83 ("firewire: new driver: nosy - IEEE 1394 traffic sniffer")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
---
drivers/firewire/nosy.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c
index ea31ac7ac1ca..f562e82e5438 100644
--- a/drivers/firewire/nosy.c
+++ b/drivers/firewire/nosy.c
@@ -494,6 +494,8 @@ irq_handler(int irq, void *device)
return IRQ_HANDLED;
}
+#define RCV_BUFFER_SIZE (16 * 1024)
+
static void
remove_card(struct pci_dev *dev)
{
@@ -517,16 +519,14 @@ remove_card(struct pci_dev *dev)
lynx->rcv_start_pcl, lynx->rcv_start_pcl_bus);
dma_free_coherent(&lynx->pci_device->dev, sizeof(struct pcl),
lynx->rcv_pcl, lynx->rcv_pcl_bus);
- dma_free_coherent(&lynx->pci_device->dev, PAGE_SIZE, lynx->rcv_buffer,
- lynx->rcv_buffer_bus);
+ dma_free_coherent(&lynx->pci_device->dev, RCV_BUFFER_SIZE,
+ lynx->rcv_buffer, lynx->rcv_buffer_bus);
iounmap(lynx->registers);
pci_disable_device(dev);
lynx_put(lynx);
}
-#define RCV_BUFFER_SIZE (16 * 1024)
-
static int
add_card(struct pci_dev *dev, const struct pci_device_id *unused)
{
@@ -680,7 +680,7 @@ add_card(struct pci_dev *dev, const struct pci_device_id *unused)
dma_free_coherent(&lynx->pci_device->dev, sizeof(struct pcl),
lynx->rcv_pcl, lynx->rcv_pcl_bus);
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);
iounmap(lynx->registers);
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] firewire: nosy: Fix dma_free_coherent() size
2025-12-16 16:54 [PATCH] firewire: nosy: Fix dma_free_coherent() size Thomas Fourier
@ 2025-12-16 17:47 ` Christophe JAILLET
2025-12-19 14:16 ` Takashi Sakamoto
2025-12-26 13:12 ` Takashi Sakamoto
0 siblings, 2 replies; 4+ messages in thread
From: Christophe JAILLET @ 2025-12-16 17:47 UTC (permalink / raw)
To: Thomas Fourier
Cc: Takashi Sakamoto, Kristian Høgsberg, Stefan Richter,
linux1394-devel, linux-kernel
Le 16/12/2025 à 17:54, Thomas Fourier a écrit :
> It looks like the buffer allocated and mapped in add_card() is done
> with size RCV_BUFFER_SIZE which is 16 KB and 4KB.
>
> Fixes: 286468210d83 ("firewire: new driver: nosy - IEEE 1394 traffic sniffer")
> Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Reviewed-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
And for the records, see [1].
CJ
[1]:
https://lore.kernel.org/lkml/20200625191554.941614-1-christophe.jaillet@wanadoo.fr/
> ---
> drivers/firewire/nosy.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c
> index ea31ac7ac1ca..f562e82e5438 100644
> --- a/drivers/firewire/nosy.c
> +++ b/drivers/firewire/nosy.c
> @@ -494,6 +494,8 @@ irq_handler(int irq, void *device)
> return IRQ_HANDLED;
> }
>
> +#define RCV_BUFFER_SIZE (16 * 1024)
Maybe this could be moved at the top of the file when #define are
usually placed.
> +
> static void
> remove_card(struct pci_dev *dev)
> {
> @@ -517,16 +519,14 @@ remove_card(struct pci_dev *dev)
> lynx->rcv_start_pcl, lynx->rcv_start_pcl_bus);
> dma_free_coherent(&lynx->pci_device->dev, sizeof(struct pcl),
> lynx->rcv_pcl, lynx->rcv_pcl_bus);
> - dma_free_coherent(&lynx->pci_device->dev, PAGE_SIZE, lynx->rcv_buffer,
> - lynx->rcv_buffer_bus);
> + dma_free_coherent(&lynx->pci_device->dev, RCV_BUFFER_SIZE,
> + lynx->rcv_buffer, lynx->rcv_buffer_bus);
>
> iounmap(lynx->registers);
> pci_disable_device(dev);
> lynx_put(lynx);
> }
>
> -#define RCV_BUFFER_SIZE (16 * 1024)
> -
> static int
> add_card(struct pci_dev *dev, const struct pci_device_id *unused)
> {
> @@ -680,7 +680,7 @@ add_card(struct pci_dev *dev, const struct pci_device_id *unused)
> dma_free_coherent(&lynx->pci_device->dev, sizeof(struct pcl),
> lynx->rcv_pcl, lynx->rcv_pcl_bus);
> 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);
> iounmap(lynx->registers);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] firewire: nosy: Fix dma_free_coherent() size
2025-12-16 17:47 ` Christophe JAILLET
@ 2025-12-19 14:16 ` Takashi Sakamoto
2025-12-26 13:12 ` Takashi Sakamoto
1 sibling, 0 replies; 4+ messages in thread
From: Takashi Sakamoto @ 2025-12-19 14:16 UTC (permalink / raw)
To: Christophe JAILLET, Thomas Fourier; +Cc: linux1394-devel, linux-kernel
Hi,
I'm sorry to be late for reply, but I'm in travel and could not process the
reviewed patches for my tree. Please wait for the next weekend.
It's our misfortune that Christophe's first proposal has been overlooked.
(The patch was posted before 2023, when I took over the role...)
Let us put it for next merge window to v6.20 kernel.
On Wed, Dec 17, 2025, at 02:47, Christophe JAILLET wrote:
> Le 16/12/2025 à 17:54, Thomas Fourier a écrit :
>> It looks like the buffer allocated and mapped in add_card() is done
>> with size RCV_BUFFER_SIZE which is 16 KB and 4KB.
>>
>> Fixes: 286468210d83 ("firewire: new driver: nosy - IEEE 1394 traffic sniffer")
>> Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
>
> Reviewed-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>
> And for the records, see [1].
>
> CJ
>
> [1]:
> https://lore.kernel.org/lkml/20200625191554.941614-1-christophe.jaillet@wanadoo.fr/
>
>> ---
>> drivers/firewire/nosy.c | 10 +++++-----
>> 1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c
>> index ea31ac7ac1ca..f562e82e5438 100644
>> --- a/drivers/firewire/nosy.c
>> +++ b/drivers/firewire/nosy.c
>> @@ -494,6 +494,8 @@ irq_handler(int irq, void *device)
>> return IRQ_HANDLED;
>> }
>>
>> +#define RCV_BUFFER_SIZE (16 * 1024)
>
> Maybe this could be moved at the top of the file when #define are
> usually placed.
>
>> +
>> static void
>> remove_card(struct pci_dev *dev)
>> {
>> @@ -517,16 +519,14 @@ remove_card(struct pci_dev *dev)
>> lynx->rcv_start_pcl, lynx->rcv_start_pcl_bus);
>> dma_free_coherent(&lynx->pci_device->dev, sizeof(struct pcl),
>> lynx->rcv_pcl, lynx->rcv_pcl_bus);
>> - dma_free_coherent(&lynx->pci_device->dev, PAGE_SIZE, lynx->rcv_buffer,
>> - lynx->rcv_buffer_bus);
>> + dma_free_coherent(&lynx->pci_device->dev, RCV_BUFFER_SIZE,
>> + lynx->rcv_buffer, lynx->rcv_buffer_bus);
>>
>> iounmap(lynx->registers);
>> pci_disable_device(dev);
>> lynx_put(lynx);
>> }
>>
>> -#define RCV_BUFFER_SIZE (16 * 1024)
>> -
>> static int
>> add_card(struct pci_dev *dev, const struct pci_device_id *unused)
>> {
>> @@ -680,7 +680,7 @@ add_card(struct pci_dev *dev, const struct pci_device_id *unused)
>> dma_free_coherent(&lynx->pci_device->dev, sizeof(struct pcl),
>> lynx->rcv_pcl, lynx->rcv_pcl_bus);
>> 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);
>> iounmap(lynx->registers);
Cheers
Takashi Sakamoto
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] firewire: nosy: Fix dma_free_coherent() size
2025-12-16 17:47 ` Christophe JAILLET
2025-12-19 14:16 ` Takashi Sakamoto
@ 2025-12-26 13:12 ` Takashi Sakamoto
1 sibling, 0 replies; 4+ messages in thread
From: Takashi Sakamoto @ 2025-12-26 13:12 UTC (permalink / raw)
To: Thomas Fourier, Christophe JAILLET; +Cc: linux1394-devel, linux-kernel
Hi,
On Tue, Dec 16, 2025 at 06:47:30PM +0100, Christophe JAILLET wrote:
> Le 16/12/2025 à 17:54, Thomas Fourier a écrit :
> > It looks like the buffer allocated and mapped in add_card() is done
> > with size RCV_BUFFER_SIZE which is 16 KB and 4KB.
> >
> > Fixes: 286468210d83 ("firewire: new driver: nosy - IEEE 1394 traffic sniffer")
> > Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
>
> Reviewed-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>
> And for the records, see [1].
>
> CJ
>
> [1]: https://lore.kernel.org/lkml/20200625191554.941614-1-christophe.jaillet@wanadoo.fr/
>
> > ---
> > drivers/firewire/nosy.c | 10 +++++-----
> > 1 file changed, 5 insertions(+), 5 deletions(-)
Applied to for-linus branch[1], with my handy modification for the place
of the macro, using 'Co-developed-by' tags with all of you. I'll send it
to mainline in this weekend so that it will be included in v6.19-rc3.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394.git/log/?h=for-linus
Thanks
Takashi Sakamoto
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-12-26 13:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-16 16:54 [PATCH] firewire: nosy: Fix dma_free_coherent() size Thomas Fourier
2025-12-16 17:47 ` Christophe JAILLET
2025-12-19 14:16 ` Takashi Sakamoto
2025-12-26 13:12 ` Takashi Sakamoto
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.