From nobody Thu Dec 18 23:24:26 2025 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D9002DC34D for ; Tue, 16 Dec 2025 16:55:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765904130; cv=none; b=ZbMgqT7zcBe6T3QKCj1bW1jKy+YRi/1ScQzGvHA6fiw1eoUXoiKy3yizqpOWgwBBKrdqiMq2g+ivUMiuiEpnhovkNyUgAOWK0DGGYK8BpWASIB1THVOwIHWH/BQUtjM169garVnIx1YwL/GUPweJLUzOdTRwe+lXhAe0W4hYRzQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765904130; c=relaxed/simple; bh=7ue0JMvnBfAK3ls8II0u5r1wDcirsBP8uKxYkdM7Ats=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Hmf2mS+4Ak+lmWLteJtShpT7FY3/iR2uyvajDVxKXgqr7hwqLB/qPLM4pKXsrQrtdxsZk636B9BdAfAXHfv16iWnaV401DKTpTuXP+eQY+1dNhJxZg1569W9QEGjeh+CuSLb1eMFVowlu0kxh9FPefjpjkrsL4AS0diqGGnWxvE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=AB7Sx0Uo; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AB7Sx0Uo" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4779ebfa91aso4229335e9.3 for ; Tue, 16 Dec 2025 08:55:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765904126; x=1766508926; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=8jgMHwZ2mJaSi552lB2XsDDOLVH0Y+0GyLtgO+iwq1Q=; b=AB7Sx0UorkOwmfl4wRlDnul6FZoPIt1ugGaIZ3GrmUENmn3Uy/DvlSIqvDBQ7X3QTq nKuPU0erpOB0/3aUmrYkNtKJKDhfr6lH72m/7aOgk5FxpCKwCA9kHJVi+s8LcC/OeaBj lXyMeT08wwCekZO6Wqlip39OgPKjcL4ObAnboQ05s98c1CG5++cxWWDliEkDgUn6Ttba JIfx3RgllUmGZ2IqhI15LrypIX0j0wWMv5hIwSdH833rvazAZq7yghAtZOhejJ0Sp62g phyXrNwJv7/Z+nORoghGu81DZkpZV81CsCsl8PJk9ypTRpFfWrrtPvoLDxuo3D1kHbbc PpVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765904126; x=1766508926; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=8jgMHwZ2mJaSi552lB2XsDDOLVH0Y+0GyLtgO+iwq1Q=; b=YaXS3bi23Zq/3b9wAL/qVuABzfNQEOImW7x+mQn8ow45ukmRBz13u3UXkmNYWUmzdO kHASC19B5H+BZaW2M3sc4uyxn7Byz25IpMnI576z3ZNc0frLvgRRT4lMHEEeFe5IcN4h AaaP9+SfHZX882hB5aqO+Cr1b47dGhYTIJJT7iz7n2Rc2m4pBME8XQvSFso4RMt68vvW mT9K4Ma7UTkDx53JKvjlBRB+kBgeebYcBMZSRIT0KvgcPYpdui1IwpVYqwlX95JVFYaB CaQzVRwmzAeBGtr8kmVq7qwH31M2sIBaF5Z+7W+vVyfieSrLKNWBinu6pQaWNJIV/22i jaAA== X-Forwarded-Encrypted: i=1; AJvYcCUA3cKPerPQ9ljd0aKimf3VjISyCAszCuXBlaEMSqLZwYTuNZpk9ME7UPAEBFjWO7/pabDm0sO8nLanwlY=@vger.kernel.org X-Gm-Message-State: AOJu0YxawhfC6mfBfWk7YW1F+5kq+K49C3xl0iNO4AiIlDKrQE4E9fHa 0gaTiGVuG5N17UXRDtvtFn5104c0n5b6n1VUsGJaqtvY0IAFRBom3i9O X-Gm-Gg: AY/fxX4BVr+Q/++38VZ7iCsOmzeVixGXXZ8zNv51i5YrhfmGbC5uewPHW5Ooh5dzuvH QXUsAaOnD2iOP3IEFP9JEnt8Bm/w1IyaORtGRIxHU3D0L5V94jD4tNQ08UBBIPCfSK1bWaXdihO RFOXUasvjRBZJf3Er1Xzq69a3JbYkRlUVzjPC+m66K0WjCwR/bn33rvqc1Ligr+pGGfZeAnXRQg JQ9RkNOx/fBL7UGR5L3UfaDu/hpNcxml97dtzoKDmWsqgKTE5gUQDwk7b4wgo3zlS7GnQ/8LWtB FZn0X4qyEO3y9mIPhT1Kcas2JIlr14Br2FT55tClrkO0NkiB4j2Tz+OOHaK1QacAMzUniNis6j6 hfcW739nxvGJFf7sY0EE3f2w4cuTWWUOfUX0p3rP3BQkDpmxqb4D1Y4KGoIUYrz8isgOB7JiUsm uEdIg00lJzcZG8zTU5n51SGXh8S6cmC0FWoN4kRcsmpfDTY/UG3v0vD+szyTuw81AFydkpdwgfF FtTGo4= X-Google-Smtp-Source: AGHT+IGjNKSVmUaxZpuc8A7rVJavwWEEbo4cZh1Madek795t4rxxyg+bFrLyyacDh0YfRnrvirb2aA== X-Received: by 2002:a5d:5f54:0:b0:42b:2deb:829 with SMTP id ffacd0b85a97d-42fb491825dmr9390060f8f.3.1765904126053; Tue, 16 Dec 2025 08:55:26 -0800 (PST) Received: from thomas-precision3591.paris.inria.fr (wifi-pro-83-215.paris.inria.fr. [128.93.83.215]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-4310adf701csm14765f8f.42.2025.12.16.08.55.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Dec 2025 08:55:25 -0800 (PST) From: Thomas Fourier To: Cc: Thomas Fourier , Takashi Sakamoto , =?UTF-8?q?Kristian=20H=C3=B8gsberg?= , Stefan Richter , linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH] firewire: nosy: Fix dma_free_coherent() size Date: Tue, 16 Dec 2025 17:54:18 +0100 Message-ID: <20251216165420.38355-2-fourier.thomas@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 sniffe= r") Signed-off-by: Thomas Fourier Reviewed-by: Christophe JAILLET --- 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; } =20 +#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); =20 iounmap(lynx->registers); pci_disable_device(dev); lynx_put(lynx); } =20 -#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_i= d *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); =20 --=20 2.43.0