Skip to content

Commit

Permalink
extcon: Remove the state_store() to prevent the wrong access
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
chanwoochoi authored and kishon committed Sep 10, 2016
1 parent 1662622 commit 0143f59
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions drivers/extcon/extcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0143f59

Please sign in to comment.