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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 22 Aug 2014 09:11:36 -0500
From:	Dan Murphy <dmurphy@...com>
To:	<linux-input@...r.kernel.org>, <dmitry.torokhov@...il.com>
CC:	<linux-kernel@...r.kernel.org>,
	<linux-arm-kernel@...ts.infradead.org>, Dan Murphy <dmurphy@...com>
Subject: [PATCH] input: misc: drv260x: add check for ERM mode and LRA Libraries

Add a check to ensure that LRA libraries are not mixed with
the ERM mode.

If ERM mode and the Library is empty "OR" the
LRA library then exit.

As the LRA and empty libraries are not applicable for
the ERM actuator.

Signed-off-by: Dan Murphy <dmurphy@...com>
---
 drivers/input/misc/drv260x.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/input/misc/drv260x.c b/drivers/input/misc/drv260x.c
index a7a19e6..d6a26a7 100644
--- a/drivers/input/misc/drv260x.c
+++ b/drivers/input/misc/drv260x.c
@@ -564,6 +564,14 @@ static int drv260x_probe(struct i2c_client *client,
 		return -EINVAL;
 	}
 
+	if (haptics->mode == DRV260X_ERM_MODE &&
+	    haptics->library == DRV260X_LIB_EMPTY ||
+	    haptics->library == DRV260X_LIB_LRA) {
+		dev_err(&client->dev,
+			"ERM Mode with LRA Library mismatch\n");
+		return -EINVAL;
+	}
+
 	haptics->regulator = devm_regulator_get(&client->dev, "vbat");
 	if (IS_ERR(haptics->regulator)) {
 		error = PTR_ERR(haptics->regulator);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ