Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1483013 > unrolled thread

[PATCH 25/51] extcon: Remove the state_store() to prevent the wrong access

Started byKishon Vijay Abraham I <kishon@ti.com>
First post2016-09-14 09:50 +0200
Last post2016-09-14 09:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 25/51] extcon: Remove the state_store() to prevent the wrong access Kishon Vijay Abraham I <kishon@ti.com> - 2016-09-14 09:50 +0200

#1483013 — [PATCH 25/51] extcon: Remove the state_store() to prevent the wrong access

FromKishon Vijay Abraham I <kishon@ti.com>
Date2016-09-14 09:50 +0200
Subject[PATCH 25/51] extcon: Remove the state_store() to prevent the wrong access
Message-ID<shd7b-6oH-9@gated-at.bofh.it>
From: Chanwoo Choi <cw00.choi@samsung.com>

This patch removes the state_store() which change the state of external
connectors with bit masking on user-space. It is wrong access to modify
the change the state of external connectors.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/extcon/extcon.c |   21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index 319659c..ad5e454 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -174,26 +174,7 @@ static ssize_t state_show(struct device *dev, struct device_attribute *attr,
 
 	return count;
 }
-
-static ssize_t state_store(struct device *dev, struct device_attribute *attr,
-			   const char *buf, size_t count)
-{
-	u32 state;
-	ssize_t ret = 0;
-	struct extcon_dev *edev = dev_get_drvdata(dev);
-
-	ret = sscanf(buf, "0x%x", &state);
-	if (ret == 0)
-		ret = -EINVAL;
-	else
-		ret = extcon_set_state(edev, state);
-
-	if (ret < 0)
-		return ret;
-
-	return count;
-}
-static DEVICE_ATTR_RW(state);
+static DEVICE_ATTR_RO(state);
 
 static ssize_t name_show(struct device *dev, struct device_attribute *attr,
 		char *buf)
-- 
1.7.9.5

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web