From: Pavel Roskin Date: Thu, 7 Jul 2011 22:14:19 +0000 (-0400) Subject: ath5k: use kstrtoint() to parse numbers coming from sysfs X-Git-Tag: firefly_0821_release~3680^2~4429^2~12^2~42^2~199 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e2df64c1d767eb52a5c617668e20745d5e3015c8;p=firefly-linux-kernel-4.4.55.git ath5k: use kstrtoint() to parse numbers coming from sysfs Signed-off-by: Pavel Roskin Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/ath/ath5k/sysfs.c b/drivers/net/wireless/ath/ath5k/sysfs.c index 1090bbab9459..5406f44309c8 100644 --- 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; \ } \