From: Pavel Kubelun Date: Mon, 28 Nov 2016 12:14:50 +0000 (+0300) Subject: net: ar8327: replace sprintf() by scnprintf() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=65b20d8b64bb5c6d8b9375d3952899b6aaaa302e;p=openwrt%2Fstaging%2Fneocturne.git net: ar8327: replace sprintf() by scnprintf() Import from https://chromium.googlesource.com/chromiumos/third_party/kernel/+/fd0c41c7b9327ce003f44df38ce42556fb177b17%5E%21/#F0 Signed-off-by: Pavel Kubelun CHROMIUM: drivers: ar8216: replace sprintf() by scnprintf() BUG=chrome-os-partner:33096 TEST=none Change-Id: Ib82035c9f2769a86d3e90f9573a09e5700ff5676 Signed-off-by: Mathieu Olivari Reviewed-on: https://chromium-review.googlesource.com/232829 Reviewed-by: Matthias Kaehlcke Tested-by: Toshi Kikuchi Reviewed-by: Toshi Kikuchi --- diff --git a/target/linux/generic/files/drivers/net/phy/ar8327.c b/target/linux/generic/files/drivers/net/phy/ar8327.c index d5cc97bc33..d2a5a5b6be 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8327.c +++ b/target/linux/generic/files/drivers/net/phy/ar8327.c @@ -306,7 +306,7 @@ ar8327_led_enable_hw_mode_show(struct device *dev, struct ar8327_led *aled = led_cdev_to_ar8327_led(led_cdev); ssize_t ret = 0; - ret += sprintf(buf, "%d\n", aled->enable_hw_mode); + ret += scnprintf(buf, PAGE_SIZE, "%d\n", aled->enable_hw_mode); return ret; } @@ -1433,4 +1433,3 @@ const struct ar8xxx_chip ar8337_chip = { .mib_decs = ar8236_mibs, .mib_func = AR8327_REG_MIB_FUNC }; -