projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e4bbf2f
)
ath5k: use kstrtoint() to parse numbers coming from sysfs
author
Pavel Roskin
<proski@gnu.org>
Thu, 7 Jul 2011 22:14:19 +0000
(18:14 -0400)
committer
John W. Linville
<linville@tuxdriver.com>
Fri, 8 Jul 2011 15:47:13 +0000
(11:47 -0400)
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath5k/sysfs.c
patch
|
blob
|
history
diff --git
a/drivers/net/wireless/ath/ath5k/sysfs.c
b/drivers/net/wireless/ath/ath5k/sysfs.c
index 1090bbab945942c544e496873360ace6fb001caf..5406f44309c85b292abed48a752cfe9d426e71a9 100644
(file)
--- a/
drivers/net/wireless/ath/ath5k/sysfs.c
+++ b/
drivers/net/wireless/ath/ath5k/sysfs.c
@@
-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; \
} \