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: <20190106083754.6004-8-afaerber@suse.de>
Date:   Sun,  6 Jan 2019 09:37:50 +0100
From:   Andreas Färber <afaerber@...e.de>
To:     linux-lpwan@...ts.infradead.org
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        Andreas Färber <afaerber@...e.de>,
        Ben Whitten <ben.whitten@...il.com>,
        "David S. Miller" <davem@...emloft.net>
Subject: [PATCH lora-next 07/11] net: lora: sx130x: Force regmap field writes before function boundaries

As a cautionary step, force writing out registers before calling helpers
or returning.

Cc: Ben Whitten <ben.whitten@...il.com>
Signed-off-by: Andreas Färber <afaerber@...e.de>
---
 drivers/net/lora/sx130x.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/lora/sx130x.c b/drivers/net/lora/sx130x.c
index bc2d4b1165d8..a0759e277574 100644
--- a/drivers/net/lora/sx130x.c
+++ b/drivers/net/lora/sx130x.c
@@ -315,7 +315,7 @@ static int sx130x_load_firmware(struct sx130x_priv *priv, int mcu, const struct
 
 	kfree(buf);
 
-	ret = sx130x_field_write(priv, select_mux, 1);
+	ret = sx130x_field_force_write(priv, select_mux, 1);
 	if (ret) {
 		dev_err(priv->dev, "MCU RAM release mux failed\n");
 		return ret;
@@ -359,7 +359,7 @@ static int sx130x_agc_calibrate(struct sx130x_priv *priv)
 		return ret;
 	}
 
-	ret = sx130x_field_write(priv, F_MCU_RST_1, 0);
+	ret = sx130x_field_force_write(priv, F_MCU_RST_1, 0);
 	if (ret) {
 		dev_err(priv->dev, "MCU 1 reset failed\n");
 		return ret;
@@ -459,7 +459,7 @@ static int sx130x_load_all_firmware(struct sx130x_priv *priv)
 		return ret;
 	}
 
-	ret = sx130x_field_write(priv, F_MCU_RST_1, 0);
+	ret = sx130x_field_force_write(priv, F_MCU_RST_1, 0);
 	if (ret) {
 		dev_err(priv->dev, "MCU 1 release failed\n");
 		return ret;
@@ -542,7 +542,7 @@ static int sx130x_loradev_open(struct net_device *netdev)
 		goto err_reg;
 	}
 
-	ret = sx130x_field_write(priv, F_CLK32M_EN, 1);
+	ret = sx130x_field_force_write(priv, F_CLK32M_EN, 1);
 	if (ret) {
 		dev_err(priv->dev, "enable 32M clock failed (%d)\n", ret);
 		goto err_reg;
@@ -708,7 +708,7 @@ int sx130x_probe(struct device *dev)
 
 	msleep(5);
 
-	ret = sx130x_field_write(priv, F_RADIO_RST, 0);
+	ret = sx130x_field_force_write(priv, F_RADIO_RST, 0);
 	if (ret) {
 		dev_err(dev, "radio deassert reset failed (%d)\n", ret);
 		return ret;
-- 
2.16.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ