lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250211-cs_dsp-gfp_dma-v1-2-afc346363832@linutronix.de>
Date: Tue, 11 Feb 2025 18:03:29 +0100
From: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
To: Simon Trimmer <simont@...nsource.cirrus.com>, 
 Charles Keepax <ckeepax@...nsource.cirrus.com>, 
 Richard Fitzgerald <rf@...nsource.cirrus.com>, 
 Mark Brown <broonie@...nel.org>
Cc: patches@...nsource.cirrus.com, linux-kernel@...r.kernel.org, 
 Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Subject: [PATCH 2/2] firmware: cs_dsp: Remove bounce buffer in
 cs_dsp_coeff_write_ctrl_raw()

regmap_raw_write() is not allowed to modify the input data.
With the removal of GFP_DMA from the bounce buffer it does not serve any
purpose anymore, remove it.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
---
 drivers/firmware/cirrus/cs_dsp.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/firmware/cirrus/cs_dsp.c b/drivers/firmware/cirrus/cs_dsp.c
index 2a85c1009f10273bee3656e5f7aebe31862036b2..5f1b3e3329bc80f80f66b3dbf7c8d6eb015ddb97 100644
--- a/drivers/firmware/cirrus/cs_dsp.c
+++ b/drivers/firmware/cirrus/cs_dsp.c
@@ -755,7 +755,6 @@ static int cs_dsp_coeff_write_ctrl_raw(struct cs_dsp_coeff_ctl *ctl,
 				       unsigned int off, const void *buf, size_t len)
 {
 	struct cs_dsp *dsp = ctl->dsp;
-	void *scratch;
 	int ret;
 	unsigned int reg;
 
@@ -763,22 +762,14 @@ static int cs_dsp_coeff_write_ctrl_raw(struct cs_dsp_coeff_ctl *ctl,
 	if (ret)
 		return ret;
 
-	scratch = kmemdup(buf, len, GFP_KERNEL);
-	if (!scratch)
-		return -ENOMEM;
-
-	ret = regmap_raw_write(dsp->regmap, reg, scratch,
-			       len);
+	ret = regmap_raw_write(dsp->regmap, reg, buf, len);
 	if (ret) {
 		cs_dsp_err(dsp, "Failed to write %zu bytes to %x: %d\n",
 			   len, reg, ret);
-		kfree(scratch);
 		return ret;
 	}
 	cs_dsp_dbg(dsp, "Wrote %zu bytes to %x\n", len, reg);
 
-	kfree(scratch);
-
 	return 0;
 }
 

-- 
2.48.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ