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]
Date:	Tue,  2 Aug 2016 13:32:53 -0700
From:	Guenter Roeck <groeck@...omium.org>
To:	Felipe Balbi <felipe.balbi@...ux.intel.com>
Cc:	Chandra Sekhar Anagani <chandra.sekhar.anagani@...el.com>,
	Bruce Ashfield <bruce.ashfield@...driver.com>,
	Bin Gao <bin.gao@...el.com>,
	Pranav Tipnis <pranav.tipnis@...el.com>,
	Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
	linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
	Guenter Roeck <groeck@...omium.org>
Subject: [RFC PATCH 2/4] usb: typec: Do not check if connected when setting roles

The connection status can change after the connection status was
checked. Leave it up to the driver to perform the necessary checks.

Signed-off-by: Guenter Roeck <groeck@...omium.org>
---
 drivers/usb/typec/typec.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/usb/typec/typec.c b/drivers/usb/typec/typec.c
index 0d0ebed..a0ae0d6 100644
--- a/drivers/usb/typec/typec.c
+++ b/drivers/usb/typec/typec.c
@@ -859,9 +859,6 @@ current_data_role_store(struct device *dev, struct device_attribute *attr,
 		return -EOPNOTSUPP;
 	}
 
-	if (!port->connected)
-		return size;
-
 	ret = match_string(typec_data_roles, ARRAY_SIZE(typec_data_roles), buf);
 	if (ret < 0)
 		return ret;
@@ -918,9 +915,6 @@ static ssize_t current_power_role_store(struct device *dev,
 		return -EIO;
 	}
 
-	if (!port->connected)
-		return size;
-
 	ret = match_string(typec_roles, ARRAY_SIZE(typec_roles), buf);
 	if (ret < 0)
 		return ret;
-- 
2.6.6

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ