Skip to content

Commit

Permalink
ath5k: use kstrtoint() to parse numbers coming from sysfs
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Pavel Roskin authored and John W. Linville committed Jul 8, 2011
1 parent e4bbf2f commit e2df64c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/wireless/ath/ath5k/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ static ssize_t ath5k_attr_store_##name(struct device *dev, \
const char *buf, size_t count) \
{ \
struct ath5k_softc *sc = dev_get_drvdata(dev); \
int val; \
int val, ret; \
\
val = (int)simple_strtoul(buf, NULL, 10); \
ret = kstrtoint(buf, 10, &val); \
if (ret < 0) \
return ret; \
set(sc->ah, val); \
return count; \
} \
Expand Down

0 comments on commit e2df64c

Please sign in to comment.